Skip to content
RCE Write-up Advanced

Executive Summary

Apache Dubbo versions up to 2.7.3 with HTTP remoting enabled deserialise untrusted Java objects using Spring's HttpInvokerServiceExporter, which lacks a class whitelist. An unauthenticated attacker who knows the bean URL can send a malicious serialised object that triggers a gadget chain, leading to remote code execution.

checkmarx.com

Published on checkmarx.com

Having developed a high level of interest in serialization attacks in recent years, I’ve decided to put some effort into researching Apache Dubbo some months back. Dubbo, I’ve learned, deserializes many things in many ways, and whose usage world-wide has grown significantly after its adoption by the Apache Foundation.

The author, on checkmarx.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 use of Spring's HttpInvokerServiceExporter, which deserialises Java objects from untrusted HTTP requests using ObjectInputStream without a class whitelist, combined with a gadget chain available in the classpath.

Impact

An unauthenticated attacker could execute arbitrary OS commands on the Dubbo provider, and could potentially compromise an entire Dubbo cluster by replacing the provider with a malicious one.

What the attacker needed

Dubbo version <= 2.7.3; HTTP protocol enabled; Knowledge of the bean URL

The fix

The Apache Dubbo team resolved the issue by updating FastJSON and replacing the deserialization mechanism used by the HTTP protocol; the report also recommends discontinuing use of HttpInvokerServiceExporter and using a whitelist-based solution.

How it was found

  1. Set up a Dubbo provider and registry following the official quick-start guide.
  2. Enable the Dubbo HTTP service by changing the protocol name to 'http' in the provider configuration.
  3. Identify the URL of the Dubbo HTTP bean, for example from a Zookeeper registry or by observing traffic.
  4. Send a POST request to that URL with a body containing a malicious serialised Java object (gadget chain).
  5. The server deserialises the object, triggering the gadget chain and executing arbitrary OS commands.

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.

When a program accepts data from the network and turns it back into objects, it can be tricked into creating harmful objects if it does not check what it is building. Here, Dubbo used a Spring component that turns network data into Java objects without any restrictions, so an attacker could send a crafted object that runs commands on the server. This is called unsafe deserialization.

What is RCE?

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

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.