CVE-2022-46175

CVSS V2 None CVSS V3 None
Description
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.
Overview
  • CVE ID
  • CVE-2022-46175
  • Assigner
  • security-advisories@github.com
  • Vulnerability Status
  • Analyzed
  • Published Version
  • 2022-12-24T04:15:08
  • Last Modified Date
  • 2023-02-28T18:36:31
CPE Configuration (Product)
CPE Vulnerable Operator Version Start Version End
cpe:2.3:a:json5:json5:*:*:*:*:*:node.js:*:* 1 OR 2.2.2
History
Created Old Value New Value Data Type Notes
2022-12-24 05:15:34 Added to TrackCVE
2022-12-24 05:15:35 Weakness Enumeration new
2022-12-25 02:16:04 2022-12-25T02:07:49 CVE Modified Date updated
2022-12-25 02:16:04 Received Awaiting Analysis Vulnerability Status updated
2022-12-29 16:14:58 Awaiting Analysis Undergoing Analysis Vulnerability Status updated
2022-12-30 22:15:29 2022-12-30T22:04:42 CVE Modified Date updated
2022-12-30 22:15:29 Undergoing Analysis Analyzed Vulnerability Status updated
2022-12-30 22:15:34 CPE Information updated
2023-01-03 18:17:02 2023-01-03T17:15:10 CVE Modified Date updated
2023-01-03 18:17:02 Analyzed Modified Vulnerability Status updated
2023-01-03 18:17:03 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 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. 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 version 2.2.2 and later. 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. Description updated
2023-01-03 18:17:06 References updated
2023-01-09 20:19:55 Modified Undergoing Analysis Vulnerability Status updated
2023-01-20 21:13:46 2023-01-20T20:10:35 CVE Modified Date updated
2023-01-20 21:13:46 Undergoing Analysis Analyzed Vulnerability Status updated
2023-01-30 03:17:26 2023-01-30T03:15:09 CVE Modified Date updated
2023-01-30 03:17:26 Analyzed Modified Vulnerability Status updated
2023-01-30 03:17:27 References updated
2023-01-30 17:14:36 Modified Undergoing Analysis Vulnerability Status updated
2023-02-28 20:13:43 2023-02-28T18:36:31 CVE Modified Date updated
2023-02-28 20:13:43 Undergoing Analysis Analyzed Vulnerability Status updated