Vulnerability library
Security checkFebruary 22, 2024

Prototype Pollution in JSON5 via Parse Method

Understand the exposure, see the recommended fix, and check whether your own website has related weaknesses.

High severitynpmjson5

Check your website

Find this and other vulnerabilities with a free scan.

Your scan runs on your computer. No account required.

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 scan

Related Issues

See something that needs correcting? Let us knowUpdated February 22, 2024