POC — CVE-2024–21534 Jsonpath-plus vulnerable to Remote Code Execution (RCE) due to improper input sanitization
The jsonpath-plus package before version 10.0.0 (and 10.2.0) fails to sanitise input, allowing an unauthenticated attacker to execute arbitrary code on the server by sending a crafted JSONPath expression. This can lead to full system compromise.
Published on medium.verylazytech.com
✨ For the Free article click here
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 unsafe default usage of the Node.js vm module without proper input sanitisation allows code injection through JSONPath expressions.
Impact
An unauthenticated attacker could execute arbitrary code on the server, potentially compromising the entire system.
What the attacker needed
Target runs vulnerable jsonpath-plus; Attacker can send HTTP requests; Attacker has a listener
The fix
The vulnerability was fixed in jsonpath-plus version 10.0.0 and later (10.2.0).
How it was found
- Clone the exploit repository or copy the script manually.
- Start a listener on the attacker machine using netcat.
- Run the exploit script with the victim URL, attacker IP, and attacker port.
- The script sends a POST request with a crafted JSON payload to the victim URL.
- The payload triggers remote code execution, connecting back to the listener.
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.
A library used to search JSON data does not check the search patterns it receives. An attacker can send a special pattern that makes the server run their own commands, giving them control of the machine.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.