CVE-2024-21534: Jsonpath plus Remote Code Execution Vulnerability
CRITICALCVE-2024-21534 is a CRITICAL (CVSS 9.8) remote code execution vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Jsonpath plus libraries in the npm ecosystem. The issue involves jsonpath plus remote code execution (rce) vulnerability. Remediation is available by upgrading affected packages to version 10.2.0.
CVE-2024-21534 at a Glance
Security Impact
CVSS: 9.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2024-21534
To remediate this vulnerability, upgrade all affected Jsonpath plus dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install jsonpath-plus@10.2.0
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>jsonpath-plus</artifactId>
<version>Latest secure release</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls jsonpath-plus
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2024-21534, inspect your project dependencies using npm:
npm ls jsonpath-plus
Analyze the terminal output to locate any version of Jsonpath plus in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 10.2.0), your application is affected.
Note: The npm ls jsonpath-plus command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Jsonpath plus, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-21534 Affected Jsonpath plus Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
jsonpath-plus
|
npm |
< 10.2.0
|
10.2.0
|
|
org.webjars.npm:jsonpath-plus
|
Maven |
≤ 6.0.1
|
|
References
Frequently Asked Questions
What is CVE-2024-21534?
Which Jsonpath plus versions are affected?
What version fixes CVE-2024-21534?
Is jsonpath-plus affected?
What is the CVSS score of CVE-2024-21534?
What CWE is associated with CVE-2024-21534?
How can I check npm dependencies for CVE-2024-21534?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-pppg-cpfq-h7wr",
"modified" : "2025-02-06T19:11:00Z",
"published" : "2024-10-11T15:30:32Z",
"aliases" : [ "CVE-2024-21534" ],
"summary" : "JSONPath Plus Remote Code Execution (RCE) Vulnerability",
"details" : "Versions of the package jsonpath-plus before 10.0.7 are vulnerable to Remote Code Execution (RCE) due to improper input sanitization. An attacker can execute aribitrary code on the system by exploiting the unsafe default usage of vm in Node.\n\n**Note:**\n\nThere were several attempts to fix it in versions [10.0.0-10.1.0](https://github.com/JSONPath-Plus/JSONPath/compare/v9.0.0...v10.1.0) but it could still be exploited using [different payloads](https://github.com/JSONPath-Plus/JSONPath/issues/226)",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "jsonpath-plus"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "10.2.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.webjars.npm:jsonpath-plus"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "6.0.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-21534"
}, {
"type" : "WEB",
"url" : "https://github.com/JSONPath-Plus/JSONPath/issues/226"
}, {
"type" : "WEB",
"url" : "https://github.com/JSONPath-Plus/JSONPath/issues/226#issuecomment-2424230316"
}, {
"type" : "WEB",
"url" : "https://github.com/JSONPath-Plus/JSONPath/pull/233"
}, {
"type" : "WEB",
"url" : "https://github.com/JSONPath-Plus/JSONPath/commit/6b2f1b4c234292c75912b790bf7e2d7339d4ccd3"
}, {
"type" : "WEB",
"url" : "https://github.com/JSONPath-Plus/JSONPath/commit/73ad72e5ee788d8287dea6e8283a3f16f63c9eb8"
}, {
"type" : "WEB",
"url" : "https://github.com/JSONPath-Plus/JSONPath/commit/b70aa713553caf838a63bac923195a5bc541fd72"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/JSONPath-Plus/JSONPath"
}, {
"type" : "WEB",
"url" : "https://github.com/JSONPath-Plus/JSONPath/compare/v9.0.0...v10.1.0"
}, {
"type" : "WEB",
"url" : "https://security.snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-8185019"
}, {
"type" : "WEB",
"url" : "https://security.snyk.io/vuln/SNYK-JS-JSONPATHPLUS-7945884"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-94" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2024-10-14T16:27:22Z",
"nvd_published_at" : "2024-10-11T13:15:15Z"
}
}