AMF – Another Malicious Format
Several Java AMF libraries accept attacker-controlled class names and properties, and treat the Flash externalizable trait as Java's Externalizable interface, letting an attacker reconstruct RMI reference objects. This can turn a crafted AMF message into a Java deserialization path and ultimately unauthenticated remote code execution.
Published on codewhitesec.blogspot.com
AMF is a binary serialization format primarily used by Flash applications. Code White has found that several Java AMF libraries contain vulnerabilities, which result in unauthenticated remote code execution.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the libraries map attacker-supplied AMF class names and traits directly onto Java classes, including java.io.Externalizable implementations such as the RMI reference classes, without any allowlist.
Impact
An unauthenticated attacker could achieve remote code execution on applications using the affected libraries, though the text only demonstrates the outbound RMI connection, not full code execution.
What the attacker needed
Network access to the AMF endpoint; vulnerable AMF library in use; attacker-controlled RMI listener
The fix
Adobe/Apache users should upgrade to Apache Flex BlazeDS 4.7.3, and operators should enable JDK serialization filters (JEP 290); Exadel, GraniteDS and WebORB had no fix at the time.
How it was found
- Start a listener that speaks the Java RMI transport protocol.
- Send an AMF message containing a sun.rmi.server.UnicastRef object to the vulnerable library.
- Observe the server connecting back to the listener.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
AMF is a compact data format that Flash programs use to talk to a server. The libraries that read it trusted the class names and properties inside the message, so a sender could ask the server to build objects of their choosing. Some of those objects can trigger a chain that ends in the server running the attacker's code.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.