CVE-2024-21534: JSONPath Plus remote code execution via unsafe vm usage

CVE-2024-21534 · Severity: low · CVSS 3.1 · Published 2024-10-11

JSONPath Plus is a JavaScript library for querying JSON data using JSONPath expressions. Due to improper input sanitization in its vm module usage, attackers can execute arbitrary code on systems running vulnerable versions by crafting malicious path expressions. This allows complete system compromise including data theft, service disruption, and lateral movement.

Vendors: Maven, npm.

Quick answers

Is CVE-2024-21534 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2024-21534 being exploited in the wild.
How severe is CVE-2024-21534?
Low severity, with a CVSS score of 3.1, published 11 October 2024.
Which products and versions are affected?
org.webjars.npm:jsonpath-plus (Maven) ECOSYSTEM:introduced=0,last_affected=6.0.1; jsonpath-plus (npm) SEMVER:introduced=0,fixed=10.2.0.
Is there a fix for CVE-2024-21534?
Yes. jsonpath-plus (npm): upgrade to 10.2.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2024-21534 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2024-21534?
Check whether you run org.webjars.npm:jsonpath-plus (Maven) or jsonpath-plus (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • jsonpath-plus (npm): upgrade to 10.2.0 or later
    npm install jsonpath-plus@10.2.0

Technical details

The vulnerability is a code injection flaw (CWE-94) in jsonpath-plus versions before 10.2.0 that stems from unsafe use of Node.js's vm module without proper input sanitization. An attacker can craft specially crafted JSONPath expressions as the `path` parameter to execute arbitrary JavaScript code with the privileges of the Node.js process. The attack requires network access to an application using the library but no authentication or user interaction. Multiple patch attempts (versions 10.0.0-10.1.0) were bypassed with alternative payloads, requiring fixes in version 10.2.0 or later.

Affected products

  • JSONPath-Plus JSONPath before 10.2.0

Identifiers

  • CVE-2024-21534
  • GHSA-pppg-cpfq-h7wr

Timeline

  • 2024-10-11: disclosed: CVE-2024-21534 published
  • 2024-10-16: other: Additional RCE bypass demonstrated in version 10.0.0
  • 2024-10-14: patched: Fix released in version 10.2.0

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.