9.2critical
jsonpath has Arbitrary Code Injection via Unsafe Evaluation of JSON Path Expressions
- Severity
- 9.2critical CVSS:4.0 by snyk
- Exploit likelihood
- 1.78% (higher than 79% of CVEs)
- Published
- Last changed
- Assigned by
- snyk
- Also known as
- GHSA-87r5-mp6g-5w5j
Description
Versions of the package jsonpath before 1.3.0 are vulnerable to Arbitrary Code Injection via unsafe evaluation of user-supplied JSON Path expressions. The library relies on the static-eval module to process JSON Path input, which is not designed to handle untrusted data safely. An attacker can exploit this vulnerability by supplying a malicious JSON Path expression that, when evaluated, executes arbitrary JavaScript code, leading to Remote Code Execution in Node.js environments or Cross-site Scripting (XSS) in browser contexts. This affects all methods that evaluate JSON Paths against objects, including .query, .nodes, .paths, .value, .parent, and .apply.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| jsonpath | before 1.3.0 | CVE List |
| org.webjars.npm:jsonpath | before * | CVE List |
| ansible-automation-platform-25/lightspeed-rhel8 | Not specified Not affected: from 1774446874 before * | CVE List |
| ansible-automation-platform-26/lightspeed-rhel9 | Not specified Not affected: from 1774363040 before *, from 1787244079 before * | CVE List |
| rhdh/rhdh-hub-rhel9 | Not specified Not affected: from 1775140647 before * | CVE List |
| migration-toolkit-virtualization/mtv-console-plugin-rhel9 | Not specified | CVE List |
| mtv-candidate/mtv-console-plugin-rhel9 | Not specified | CVE List |
| openshift-pipelines/pipelines-hub-api-rhel8 | Not specified | CVE List |
| openshift-pipelines/pipelines-hub-db-migration-rhel8 | Not specified | CVE List |
| openshift-pipelines/pipelines-hub-ui-rhel8 | Not specified | CVE List |
| ansible-on-clouds/aoc-azure-aap-installer-rhel9 | Not specified | CVE List |
| rhelai3/bootc-cuda-rhel9 | Not specified | CVE List |
| rhelai3/disk-image-cuda-rhel9 | Not specified | CVE List |
| io.hawt-hawtio-online | Not specified | CVE List |
| rhoai/odh-kf-notebook-controller-rhel8 | Not specified | CVE List |
| rhoai/odh-notebook-controller-rhel8 | Not specified | CVE List |
| quay/quay-rhel8 | Not specified | CVE List |
| ansible-automation-platform/automation-portal | Not specified | CVE List |
| jsonpath (npm) | before 1.3.0 | GitHub Advisory Database |
All scores
| snyk | 9.2critical CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:P |
| snyk | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:P |
| redhat-SADP | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 9.8high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:P |
Classification
SSVC (CISA-ADP): exploitation none, automatable yes, technical impact total.
What each source says
CVE List
Versions of the package jsonpath before 1.3.0 are vulnerable to Arbitrary Code Injection via unsafe evaluation of user-supplied JSON Path expressions. The library relies on the static-eval module to process JSON Path input, which is not designed to handle untrusted data safely. An attacker can exploit this vulnerability by supplying a malicious JSON Path expression that, when evaluated, executes arbitrary JavaScript code, leading to Remote Code Execution in Node.js environments or Cross-site Scripting (XSS) in browser contexts. This affects all methods that evaluate JSON Paths against objects, including .query, .nodes, .paths, .value, .parent, and .apply.
GitHub Advisory Database
Impact
Arbitrary Code Injection (Remote Code Execution & XSS):
A critical security vulnerability affects all versions of the jsonpath package. The library relies on the static-eval module to evaluate JSON Path expressions but fails to properly sanitize or sandbox the input.
This allows an attacker to inject arbitrary JavaScript code into the JSON Path expression. When the library evaluates this expression, the malicious code is executed.
- Node.js Environments: This leads to Remote Code Execution (RCE), allowing an attacker to compromise the server.
- Browser Environments: This leads to Cross-Site Scripting (XSS), allowing an attacker to hijack user sessions or exfiltrate data.
Affected Methods:
The vulnerability triggers when untrusted data is passed to any method that evaluates a path, including:
jsonpath.queryjsonpath.nodesjsonpath.pathsjsonpath.valuejsonpath.parentjsonpath.apply
Patches
No Patch Available:
Currently, all versions of jsonpath are vulnerable. There is no known patched version of this package that resolves the issue while retaining the current architecture.
Recommendation:
Developers are strongly advised to migrate to a secure alternative (such as jsonpath-plus or similar libraries that do not use eval/static-eval) or strictly validate all JSON Path inputs against a known allowlist.
Workarounds
- Strict Input Validation: Ensure that no user-supplied data is ever passed directly to
jsonpathfunctions. - Sanitization: If user input is unavoidable, implement a strict parser to reject any JSON Path expressions containing executable JavaScript syntax (e.g., parentheses
(), script expressionsscript:, or function calls).
Resources
NVD (es)
Todas las versiones del paquete jsonpath son vulnerables a Inyección de Código Arbitrario a través de la evaluación insegura de expresiones JSON Path proporcionadas por el usuario. La biblioteca se basa en el módulo static-eval para procesar la entrada JSON Path, el cual no está diseñado para manejar datos no confiables de forma segura. Un atacante puede explotar esta vulnerabilidad al proporcionar una expresión JSON Path maliciosa que, al ser evaluada, ejecuta código JavaScript arbitrario, lo que lleva a Ejecución Remota de Código en entornos Node.js o Cross-site scripting (XSS) en contextos de navegador. Esto afecta a todos los métodos que evalúan JSON Paths contra objetos, incluyendo .query, .nodes, .paths, .value, .parent y .apply.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-1615 changed 2026-08-25 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-87r5-mp6g-5w5j changed 2026-03-19 | CC-BY-4.0 |
| NVD | CVE-2026-1615 changed 2026-08-25 | Public domain |