Skip to content
RCE Advisory Advanced CVE-2023-45146

GHSL-2023-052: Unsafe deserialization in XXL-RPC - CVE-2023-45146

The XXL-RPC framework's Netty server with Hessian serialization deserializes untrusted data without validation, allowing an attacker to send a malicious serialized object that can execute arbitrary code. This can lead to remote code execution and full control of the server.

ghsecuritylab Follow

Originally disclosed on GitHub Security Lab

XXL-RPC is a high performance, distributed RPC framework. With it, a TCP server can be set up using the Netty framework and the Hessian serialization mechanism.

ghsecuritylab, on GitHub Security Lab

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 report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The server directly deserializes untrusted network data using the Hessian library without any validation or class filtering.

Impact

This issue may lead to Remote Code Execution (RCE), allowing an attacker to take control of the machine running the server.

What the attacker needed

XXL-RPC server using Netty and Hessian; Rome library in classpath; Remote class loading allowed

How it was found

  1. Set up an XXL-RPC server using NettyServer and HessianSerializer.
  2. Generate a malicious Hessian payload using marshalsec with a JNDI reference to an attacker-controlled LDAP server.
  3. Start a malicious LDAP server that returns a reference to a remote codebase hosting a malicious class.
  4. Host the malicious class file on an HTTP server.
  5. Send the payload to the Netty server via a TCP client, including the payload length and data.
  6. The server deserializes the payload, triggers JNDI lookup, loads the remote class, and executes its static initializer, achieving RCE.

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 report has not been written yet. The Original tab links to the source.

When a program receives data over the network, it sometimes converts that data back into objects, a process called deserialization. If the data is not checked, an attacker can craft it so that the conversion runs harmful code. Here, the XXL-RPC server does exactly that, letting an attacker run commands on the server.

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 ghsecuritylab

View all

132 more disclosed reports, best first.

More from GitHub Security Lab

View all

The newest disclosed reports for this program.

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.