Skip to content
RCE Write-up Advanced

Exploiting Adobe ColdFusion before CVE-2017-3066

Adobe ColdFusion deserialised untrusted AMF data without class whitelisting, allowing an attacker to send a crafted AMF message that triggers Java native deserialisation and achieve remote code execution. The report describes two gadget chains that work without an outgoing TCP connection, one for ColdFusion 12 and one for both 11 and 12.

Unknown Follow

Published on codewhitesec.blogspot.com

In a recent penetration test my teammate Thomas came across several servers running Adobe ColdFusion 11 and 12. Some of them were vulnerable to CVE-2017-3066 but no outgoing TCP connections were possible to exploit the vulnerability.

Unknown, on codewhitesec.blogspot.com

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 lack of a class whitelist during AMF deserialisation, allowing any class on the classpath to be instantiated and its setters or readExternal method invoked, which led to Java native deserialisation of attacker-controlled data.

Impact

An attacker could achieve remote code execution on the ColdFusion server, potentially gaining a SYSTEM shell, without needing an outgoing TCP connection.

What the attacker needed

Network access to the ColdFusion AMF endpoint; no outgoing TCP connection needed

The fix

Apache introduced validation through a class deserialisation validator with a default whitelist, which can also be configured with a configuration file.

How it was found

  1. Find a call graph from an AMF deserialisation entry point to ObjectInputStream.readObject().
  2. Identify a class with a setter or readExternal method that reaches readObject().
  3. Craft an AMF message that instantiates that class and supplies the serialised Java payload.
  4. Send the AMF message to the ColdFusion server to trigger deserialisation and execute the payload.

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.

Adobe ColdFusion is a server that runs web applications. It can receive data in a binary format called AMF. The server took that data and turned it back into Java objects without checking which classes were allowed. An attacker could send a special object that, when turned back into a Java object, ran code on the server. This is called deserialisation, and it is dangerous because it lets the attacker control what the server does.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by Unknown

View all

32 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.