Skip to content
RCE Advisory Advanced CVE-2023-42809

GHSL-2023-053: Unsafe deserialization in Redisson - CVE-2023-42809

Redisson's SerializationCodec deserializes Java objects from Redis server responses without validation. An attacker controlling a malicious Redis server could send crafted objects that execute arbitrary code on the client machine.

ghsecuritylab Follow

Originally disclosed on GitHub Security Lab

Redisson is a Java Redis client that uses the Netty framework. Some of the messages received from the Redis server contain Java objects that the client deserializes without further validation.

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 client used Java's ObjectInputStream to deserialize data from the server without restricting which classes could be loaded, allowing gadget chains to execute code.

Impact

This issue may lead to remote code execution, allowing an attacker to take control of the machine running the client.

What the attacker needed

Client uses SerializationCodec; attacker controls or spoofs Redis server; victim connects to malicious server

The fix

The fix added an optional allowlist of class names to SerializationCodec, but it is not enabled by default; users should use the constructor that accepts a set of allowed classes.

How it was found

  1. Configure Redisson to use SerializationCodec and connect to a server.
  2. Set up a malicious server that responds to commands like HGET with a crafted message.
  3. The client sends a command such as HGET and receives the malicious response.
  4. The response contains a serialized Java object that, when deserialized, 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 report has not been written yet. The Original tab links to the source.

When a program receives data from another computer, it sometimes turns that data back into objects (like a Java object). If it does this without checking what kind of object it is, an attacker can send a malicious object that runs code when opened. Here, Redisson did that with data from a Redis server, so a bad server could take over the client.

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.