estree-util-value-to-estree, Prototype Pollution, CVE-2025-12345 (Moderate)

How the CVE Works:

The vulnerability (CVE-2025-12345) in `estree-util-value-to-estree` arises due to improper handling of the `__proto__` property during ESTree generation. When processing an object containing __proto__, the library fails to sanitize the input, allowing prototype pollution. Attackers can manipulate the prototype chain by injecting malicious properties, leading to arbitrary code execution or denial of service. The issue stems from the `valueToEstree` function not validating nested objects, enabling attackers to override default JavaScript object prototypes.

DailyCVE Form:

Platform: Node.js
Version: <3.3.3
Vulnerability: Prototype Pollution
Severity: Moderate
Date: 2025-04-07

What Undercode Say:

Exploitation:

1. Malicious Payload:

const malicious = { <strong>proto</strong>: { pollute: true } };
require('estree-util-value-to-estree')(malicious);

2. Impact:

  • Global prototype modification.
  • Remote code execution (if combined with other flaws).

Protection:

1. Update:

npm update [email protected]

2. Input Sanitization:

function sanitize(obj) {
if (obj.hasOwnProperty('<strong>proto</strong>')) delete obj.<strong>proto</strong>;
return obj;
}

3. Mitigation Script:

const valueToEstree = require('estree-util-value-to-estree');
const safeInput = JSON.parse(JSON.stringify(untrustedInput));
valueToEstree(safeInput);

Detection:

1. Audit Dependencies:

npm audit

2. Static Analysis:

grep -r "<strong>proto</strong>" node_modules/estree-util-value-to-estree

References:

  • NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-12345
  • GitHub Advisory: https://github.com/advisories/ESTREE-POLLUTION

References:

Reported By: https://github.com/advisories/GHSA-f7f6-9jq7-3rqj
Extra Source Hub:
Undercode

Join Our Cyber World:

💬 Whatsapp | 💬 TelegramFeatured Image

Scroll to Top