estree-util-value-to-estree allows prototype pollution in generated ESTree
Moderate severity
GitHub Reviewed
Published
Apr 6, 2025
in
remcohaszing/estree-util-value-to-estree
•
Updated Apr 7, 2025
Description
Published by the National Vulnerability Database
Apr 7, 2025
Published to the GitHub Advisory Database
Apr 7, 2025
Reviewed
Apr 7, 2025
Last updated
Apr 7, 2025
Impact
When generating an ESTree from a value with a property named
__proto__
,valueToEstree
would generate an object that specifies a prototype instead.Example:
Output:
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 tovalueToEstree
.References