Skip to content
RCE Write-up Advanced

Apache Dubbo Consumer Risks: The Road Not Taken

Apache Dubbo consumers deserialise responses from providers without adequately restricting the serialisation type, so a malicious provider can force unsafe native Java deserialisation. An attacker who can register or control a provider could achieve remote code execution on the consumer.

Yaniv Nizry Follow

Published on sonarsource.com

Apache Dubbo is a popular Java open-source, high-performance RPC (Remote Procedure Call) framework designed to simplify the development of microservices-based and distributed systems. Originally created by Alibaba, Dubbo has gained widespread popularity and is now maintained as a top-level Apache project with 40K…

Yaniv Nizry (@YNizry), on sonarsource.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

Impact

Consumers that invoke RPC functions on untrusted providers or use non-secure registries are susceptible to arbitrary object deserialisation, which can eventually result in remote code execution.

What the attacker needed

Attacker can register a malicious provider; or control an existing provider; or use social engineering; registry lacks authentication

How it was found

  1. Register a malicious provider in the registry with the prefer.serialization=nativejava parameter.
  2. Ensure the provider matches the consumer's interface and version so the consumer invokes it.
  3. Send a response with a Dubbo protocol header specifying native Java serialisation and a serialised gadget payload.
  4. The consumer deserialises the response and executes arbitrary code.

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.

Dubbo is a system that lets one program call functions on another over the network. The calling program (the consumer) trusts the answer it gets back and turns it into objects without checking if the answer is safe. A bad provider can send a specially crafted answer that runs code on the consumer's machine.

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 Yaniv Nizry

View all

7 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.