Skip to content
RCE Write-up Intermediate

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.

Very Lazy Tech Follow

Published on medium.verylazytech.com

✨ For the Free article click here

Very Lazy Tech 👾, on medium.verylazytech.com

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

  1. Clone the exploit repository or copy the script manually.
  2. Start a listener on the attacker machine using netcat.
  3. Run the exploit script with the victim URL, attacker IP, and attacker port.
  4. The script sends a POST request with a crafted JSON payload to the victim URL.
  5. 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.

More by Very Lazy Tech

View all

9 more disclosed reports, best first.

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.