GHSL-2024-301: Deserialization of Untrusted Data in 274056675/springboot-openai-chatgpt
The application uses an outdated version of the fastjson library to parse user-supplied JSON, which is vulnerable to deserialization of untrusted data. An attacker could potentially achieve remote code execution by crafting a malicious JSON payload that exploits a gadget chain.
Originally disclosed on GitHub Security Lab
274056675/Springboot-openai-chatgpt is affected by a Deserialization of Untrusted Data vulnerability due to the usage of the outdated version of alibaba/fastjson library.
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 application uses an outdated version of the fastjson library (v1.2.70) that is vulnerable to deserialization attacks, and it parses untrusted user input with it.
Impact
This issue may lead to Remote Code Execution in the worst case, but the report does not provide a specific gadget chain and notes that an attacker must identify a suitable class or chain.
What the attacker needed
Attacker can send HTTP requests with JSON; a gadget chain must exist in the classpath
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.
The application takes JSON data from users and uses an old library called fastjson to convert it into Java objects. This old library has a known security flaw: if an attacker sends specially crafted JSON, the library might create objects that run harmful code. This could let an attacker take control of 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.