Security mailing lists by PureSourceCode

CVE-2022-46175

HIGH 8.8CVSS 3.1

Prototype Pollution in JSON5 via Parse Method

JSON5 is an extension to the popular JSON file format that aims to be easier to write and maintain by hand (e.g. for config files). The parse method of the JSON5 library before and including versions 1.0.1 and 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. However, polluting the prototype of a single object can have significant security impact for an application if the object is later used in trusted operations. This vulnerability could allow an attacker to set arbitrary and unexpected keys on the object returned from JSON5.parse. The actual impact will depend on how applications utilize the returned object and how they filter unwanted keys, but could include denial of service, cross-site scripting, elevation of privilege, and in extreme cases, remote code execution. JSON5.parse should restrict parsing of __proto__ keys when parsing JSON strings to objects. As a point of reference, the JSON.parse method included in JavaScript ignores __proto__ keys. Simply changing JSON5.parse to JSON.parse in the examples above mitigates this vulnerability. This vulnerability is patched in json5 versions 1.0.2, 2.2.2, and later.

Published
24 Dec 2022
Last modified
10 Sep 2026
Assigned by
security-advisories@github.com
NVD status
Modified
Weakness
CWE-1321
Also known as
GHSA-9c47-m6qq-7p4h
Sources
NVDJSONOSV GHSA-9c47-m6qq-7p4hJSON

Scores

SourceScored byVersionScoreVector / decision
NVD nvd@nist.gov (Primary) CVSS 3.1 HIGH 8.8 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
NVD security-advisories@github.com (Secondary) CVSS 3.1 HIGH 7.1 CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:H
OSV GitHub CVSS 3.1 HIGH 7.1 CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:H

Affected

SourceVendor / ecosystemProduct / packageAffected versionsFixed in
NVD json5 json5
cpe:2.3:a:json5:json5:*:*:*:*:*:node.js:*:*
< 1.0.2 1.0.2
NVD json5 json5
cpe:2.3:a:json5:json5:*:*:*:*:*:node.js:*:*
>= 2.0.0, < 2.2.2 2.2.2
NVD fedoraproject fedora
cpe:2.3:o:fedoraproject:fedora:37:*:*:*:*:*:*:*
= 37
OSV npm json5 >= 2.0.0, < 2.2.2 2.2.2
OSV npm json5 < 1.0.2 1.0.2

References

History

  • 25 Nov 2026 20:35 UTC · NVD: first stored (published 24 Dec 2022)
  • 25 Nov 2026 20:10 UTC · OSV: first stored (published 29 Dec 2022)
An unhandled error has occurred. Reload ×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.