Exploit Troubles: Problem 1 (Compression)
A Java deserialization vulnerability was found in a base64-encoded parameter that, when decoded and decompressed, revealed a serialized Java object. The attacker could achieve unauthenticated remote code execution by crafting a malicious serialized object, but exploitation required overcoming compression and class version mismatches.
rhinosecuritylabs.com
Published on rhinosecuritylabs.com
During a recent application assessment at Rhino we identified a Java deserialization vulnerability which ended up leading to unauthenticated remote code execution. Exploitation of the vulnerability turned out to not be as simple as generating a default payload using Ysoserial.
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 application deserialized untrusted data from a user-controlled parameter without proper validation, allowing an attacker to supply a malicious serialized object.
What the attacker needed
Access to the vulnerable parameter; ability to send crafted serialized objects; knowledge of server-side class versions
How it was found
- Decode the base64 parameter and decompress it to reveal a serialized Java object.
- Generate a Ysoserial payload and compress it using the same algorithm.
- Modify Ysoserial to compress the payload before output.
- Adjust the SerialVersionUID to match the server's class version.
- Send the crafted payload to achieve remote code execution.
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.
The application accepted data that was encoded and compressed, and when decoded it turned out to be a serialized Java object. Java can deserialize objects, and if an attacker sends a malicious object, the server may execute code. The article explains how to adjust attack tools to make the malicious object compatible with 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.