{"id":"CVE-2022-46175","published":"2022-12-24T00:00:00Z","modified":"2024-08-03T14:24:03Z","title":"JSON5 is an extension to the popular JSON file format that aims to be easier to write and maintain by hand (e.g. for…","vendor":"json5","product":"json5","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.1,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.09698,"percentile":0.95626,"provenance":"source"},"cwes":[{"id":"CWE-1321","name":"Improperly Controlled Modification of Object Prototype Attributes"}],"references":[{"url":"https://github.com/json5/json5/security/advisories/GHSA-9c47-m6qq-7p4h","tags":[]},{"url":"https://github.com/json5/json5/issues/199","tags":[]},{"url":"https://github.com/json5/json5/issues/295","tags":[]},{"url":"https://github.com/json5/json5/pull/298","tags":[]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3S26TLPLVFAJTUN3VIXFDEBEXDYO22CE/","tags":["vendor-advisory"]},{"url":"https://lists.debian.org/debian-lts-announce/2023/11/msg00021.html","tags":["mailing-list"]}],"priority":{"score":29.1,"factors":[{"name":"EPSS percentile","points":19.13},{"name":"Public exploit code","points":5.0},{"name":"CVSS severity","points":4.97}]},"exploitSources":{"pocGithub":{"count":1,"skipped":0,"earliest":"2023-01-11","earliestUrl":"https://github.com/giz-berlin/quasar-app-webpack-json5-vulnerability","repos":[{"name":"giz-berlin/quasar-app-webpack-json5-vulnerability","url":"https://github.com/giz-berlin/quasar-app-webpack-json5-vulnerability","stars":0,"created":"2023-01-11"}]},"first":{"date":"2023-01-11","source":"PoC-in-GitHub","url":"https://github.com/giz-berlin/quasar-app-webpack-json5-vulnerability"},"provenance":"source"},"vendorSlug":"json5","affectedVersions":[{"vendor":"json5","product":"json5","versions":["< 2.2.2"]}],"affected":[{"ecosystem":"npm","package":"json5","vulnerableRanges":[">=2.0.0, <2.2.2","<1.0.2"],"patched":["2.2.2","1.0.2"],"from":["GHSA-9c47-m6qq-7p4h"],"provenance":"source"}],"summary":{"text":"The json5 JavaScript library's parse method, in versions up to and including 1.0.1 and 2.2.1, does not restrict keys named __proto__, so specially crafted input can pollute the prototype of the object it returns. An attacker who can supply input to JSON5.parse with low privileges, and where the application later uses the returned object in trusted operations, could set arbitrary unexpected keys on it, with possible consequences ranging from denial of service to cross-site scripting, privilege escalation, or remote code execution depending on how the application uses that object.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-21T04:03:25Z"},"euvd":{"id":"EUVD-2022-7580","exploited":false,"provenance":"source"}}