Description
The parse method of the JSON5 library before and including version 2.2.1 does not restrict parsing of keys named __proto__, allowing specially crafted strings to pollute the prototype of the resulting object.
This vulnerability pollutes the prototype of the object returned by JSON5.parse and not the global Object prototype, which is the commonly understood definition of Prototype Pollution.
Recommendation
Update the json5 package to the latest compatible version. Followings are version details:
Affected version(s): **< 1.0.2 >= 2.0.0, < 2.2.2** Patched version(s): **1.0.2 2.2.2**
References
- GHSA-9c47-m6qq-7p4h
- lists.debian.org
- lists.fedoraproject.org
- CVE-2022-46175
- CWE-1321
- CAPEC-310
- OWASP 2021-A6
Related Issues
- Prototype Pollution via parse() in NodeJS flatted - CVE-2026-33228
- depath and cool-path vulnerable to Prototype Pollution via `set()` Method - depath - CVE-2024-38985
- depath and cool-path vulnerable to Prototype Pollution via `set()` Method - CVE-2024-38985
- steal vulnerable to Prototype Pollution via requestedVersion variable - CVE-2022-37257
You might also like:
- Tags:
- npm
- json5
Anything's wrong? Let us know Last updated on February 22, 2024


