Vulnerabilities in pkg:npm/jsonpath

PACKAGE
Advisory Identifier: GHSA-87r5-mp6g-5w5j
Advisory Summary

CVE-2026-1615 is a HIGH (CVSS 9.8) jsonpath has arbitrary code injection vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Jsonpath libraries in the npm ecosystem. The issue involves jsonpath has arbitrary code injection via unsafe evaluation of json path expressions. Remediation is available by upgrading affected packages to version 1.3.0.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/jsonpath

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/jsonpath. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-87r5-mp6g-5w5j CVE-2026-1615 HIGH jsonpath has Arbitrary Code Injection via Unsafe Evaluation of JSON Path Expressions
GHSA-6c59-mwgh-r2x6 CVE-2025-61140 MODERATE JSONPath vulnerable to Prototype Pollution due to insufficient input validation of object keys in lib/index.js

CVE-2026-1615 at a Glance

CVE Identifier CVE-2026-1615
GHSA Identifier GHSA-87r5-mp6g-5w5j
Severity HIGH
CVSS v3.1 Base Score 9.8
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Jsonpath
Package Ecosystem npm
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-1615

To remediate this vulnerability, upgrade all affected Jsonpath dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

jsonpath fixed: 1.3.0
npm install jsonpath@1.3.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls jsonpath

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-1615, inspect your project dependencies using npm:

npm ls jsonpath

Analyze the terminal output to locate any version of Jsonpath in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.3.0), your application is affected.

Note: The npm ls jsonpath 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, 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

### 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.query` * `jsonpath.nodes` * `jsonpath.paths` * `jsonpath.value` * `jsonpath.parent` * `jsonpath.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 `jsonpath` functions. * **Sanitization:** If user input is unavoidable, implement a strict parser to reject any JSON Path expressions containing executable JavaScript syntax (e.g., parentheses `()`, script expressions `script:`, or function calls). ### Resources * [CVE-2026-1615](https://nvd.nist.gov/vuln/detail/CVE-2026-1615) * [Vulnerable Code in handlers.js](https://github.com/dchester/jsonpath/blob/c1dd8ec74034fb0375233abb5fdbec51ac317b4b/lib/handlers.js#L243) * [Snyk Advisory (Java/WebJars)](https://security.snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-15141219) * [Snyk Advisory (JS)](https://security.snyk.io/vuln/SNYK-JS-JSONPATH-13645034)

CVE-2026-1615 Affected Jsonpath Versions

1 component(s)
Fixed Versions:
1.3.0
Product / Package Ecosystem Affected Versions Fixed Version
jsonpath
npm
< 1.3.0
1.3.0

References

Frequently Asked Questions

What is CVE-2026-1615?
CVE-2026-1615 is a security vulnerability in Jsonpath involving jsonpath has Arbitrary Code Injection via Unsafe Evaluation of JSON Path Expressions under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Jsonpath versions are affected?
Affected versions include releases prior to 1.3.0 across affected packages: jsonpath.
What version fixes CVE-2026-1615?
Upgrading to 1.3.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is jsonpath affected?
Yes, jsonpath is affected in releases prior to 1.3.0. Upgrade your dependency to 1.3.0 or later.
What is the CVSS score of CVE-2026-1615?
CVE-2026-1615 has a CVSS v3.1 base score of 9.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-1615?
CVE-2026-1615 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (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.).
How can I check npm dependencies for CVE-2026-1615?
Run the dependency tree command: 'npm ls jsonpath'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-87r5-mp6g-5w5j",
  "modified" : "2026-03-19T16:17:26Z",
  "published" : "2026-02-09T06:30:28Z",
  "aliases" : [ "CVE-2026-1615" ],
  "summary" : "jsonpath has Arbitrary Code Injection via Unsafe Evaluation of JSON Path Expressions",
  "details" : "### Impact\n\n**Arbitrary Code Injection (Remote Code Execution & XSS):**\n\nA 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.\n\nThis allows an attacker to inject arbitrary JavaScript code into the JSON Path expression. When the library evaluates this expression, the malicious code is executed.\n\n* **Node.js Environments:** This leads to **Remote Code Execution (RCE)**, allowing an attacker to compromise the server.\n* **Browser Environments:** This leads to **Cross-Site Scripting (XSS)**, allowing an attacker to hijack user sessions or exfiltrate data.\n\n**Affected Methods:**\n\nThe vulnerability triggers when untrusted data is passed to any method that evaluates a path, including:\n\n* `jsonpath.query`\n* `jsonpath.nodes`\n* `jsonpath.paths`\n* `jsonpath.value`\n* `jsonpath.parent`\n* `jsonpath.apply`\n\n### Patches\n\n**No Patch Available:**\n\nCurrently, **all versions** of `jsonpath` are vulnerable. There is no known patched version of this package that resolves the issue while retaining the current architecture.\n\n**Recommendation:**\n\nDevelopers 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.\n\n### Workarounds\n\n* **Strict Input Validation:** Ensure that no user-supplied data is ever passed directly to `jsonpath` functions.\n* **Sanitization:** If user input is unavoidable, implement a strict parser to reject any JSON Path expressions containing executable JavaScript syntax (e.g., parentheses `()`, script expressions `script:`, or function calls).\n\n### Resources\n\n* [CVE-2026-1615](https://nvd.nist.gov/vuln/detail/CVE-2026-1615)\n* [Vulnerable Code in handlers.js](https://github.com/dchester/jsonpath/blob/c1dd8ec74034fb0375233abb5fdbec51ac317b4b/lib/handlers.js#L243)\n* [Snyk Advisory (Java/WebJars)](https://security.snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-15141219)\n* [Snyk Advisory (JS)](https://security.snyk.io/vuln/SNYK-JS-JSONPATH-13645034)",
  "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:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:P"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "jsonpath"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.3.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.2.1"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-1615"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/dchester/jsonpath/pull/197"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/dchester/jsonpath/commit/491e2e01de2ff13f7d95e87eb2be726edbf4225f"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/dchester/jsonpath/commit/b61111f07ac1a8d0f3133b5fc51438ecb76a6c39"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/dchester/jsonpath"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/dchester/jsonpath/blob/c1dd8ec74034fb0375233abb5fdbec51ac317b4b/lib/handlers.js#L243"
  }, {
    "type" : "WEB",
    "url" : "https://security.snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-15141219"
  }, {
    "type" : "WEB",
    "url" : "https://security.snyk.io/vuln/SNYK-JS-JSONPATH-13645034"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-02-12T15:29:55Z",
    "nvd_published_at" : "2026-02-09T05:16:24Z"
  }
}