Advisory

GHSA-f7f6-9jq7-3rqj

Also known as: CVE-2025-32014

Summary

estree-util-value-to-estree allows prototype pollution in generated ESTree

Details

Impact
When generating an ESTree from a value with a property named __proto__, valueToEstree would generate an object that specifies a prototype instead.

Example:

import { generate } from 'astring'
import { valueToEstree } from 'estree-util-value-to-estree'

const estree = valueToEstree({
  ['__proto__']: {}
})
const code = generate(estree)
console.log(code)

Output:

{
  "__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.

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2025-04-07 19:09 UTC
Modified
2025-04-07 19:57 UTC

Affected packages and fixes

estree-util-value-to-estree

npm · All systems

Affected

  • introduced 0, fixed 3.3.3 (semver)

Fixed versions

3.3.3

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences