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
Could your website be exposed too?
SmartScanner can check your website for Prototype Pollution in JSON5 via Parse Method and gives you actionable findings to investigate.
Start a free scanRelated 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


