GHSL-2023-044: Unsafe Deserialization in Aerospike Java client - CVE-2023-36480
The Aerospike Java client deserialises Java objects from server responses without validation. An attacker who can make the client connect to a malicious server can send crafted objects that execute arbitrary code on the client machine.
Originally disclosed on GitHub Security Lab
The Aerospike Java client is a Java application that implements a network protocol to communicate with an Aerospike server. Some of the messages received from the server contain Java objects that the client deserializes when it encounters them without further validation.
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 deserialises Java objects from server responses without validating the data, allowing an attacker-controlled server to supply a malicious serialised object.
Impact
This issue may lead to Remote Code Execution (RCE) in the Java client, allowing an attacker to take control of the machine the client is running on.
What the attacker needed
Client connects to a malicious server; deserialization gadget on classpath
How it was found
- Set up a malicious Aerospike server that responds to the client's requests.
- Use the client's AsyncPutGet example with the -netty flag, which connects to localhost:3000 by default.
- Make the mock server return normal responses until an AsyncRead command occurs.
- When the AsyncRead command is detected, send a crafted response containing a serialised payload in a JBLOB particle.
- The client deserialises the payload, executing the gadget chain (e.g., Apache Commons Collections) and running 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, it sometimes turns that data back into objects (like a saved game state). If it does this without checking what is inside, an attacker can send a malicious object that runs code when opened. Here, the Aerospike client did this with data from the server, so a bad server could take over the client's computer.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.