GitHub Advisoryadvisory · npm

GHSA-f7f6-9jq7-3rqj estree-util-value-to-estree allows prototype pollution in generated ESTree

MEDIUM Published 2025-04-07 Modified 2025-04-07 Official page ↗
Aliases
CVE-2025-32014
Ecosystem
npm
Packages
estree-util-value-to-estree
Severity
Moderate
CVSS vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Weaknesses
CWE-1321
Reviewed
2025-04-07

Affected packages

• npm estree-util-value-to-estree: < 3.3.3 → fixed in 3.3.3

Description

Impact When generating an ESTree from a value with a property named `__proto__`, `valueToEstree` would generate an object that specifies a prototype instead. Example: ```js import { generate } from 'astring' import { valueToEstree } from 'estree-util-value-to-estree' const estree = valueToEstree({ ['__proto__']: {} }) const code = generate(estree) console.log(code) ``` Output: ```js { "__proto__": {} } ``` Patches This was fixed in version 3.3.3. Workarounds If you control the input, don’t specify a property named `__proto__`. If you don’t control the output, strip any properties named `__proto__` before passing it to `valueToEstree`.

Related

Alias · CVE (1)

  • CVE-2025-32014 estree-util-value-to-estree converts a JavaScript value to an ESTree expression. vulnerability

Weakness · CWE (1)

  • CWE-1321 Improperly Controlled Modification of Object Prototype Attributes weakness

References