CVE-2022-46175
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.
What to do
Fixed builds are available from Debian, Ubuntu, npm: see the table below for the fixed version per release.
Red Hat, Ubuntu have not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.04 | node-json5 | Not affected vulnerable_code_not_present | ||
| Ubuntu 25.10 | node-json5 | Not affected vulnerable_code_not_present | ||
| Ubuntu 24.04 | node-json5 | Not affected vulnerable_code_not_present | ||
| Ubuntu 22.04 | node-json5 | Fix pending | 2.2.0+dfsg-1ubuntu0.1~esm1 (Ubuntu Pro) | UBUNTU-CVE-2022-46175 |
| Ubuntu 20.04 | node-json5 | Fixed | 0.5.1-3ubuntu0.1 | UBUNTU-CVE-2022-46175 |
| Ubuntu 18.04 | node-json5 | Fix pending | 0.5.1-1ubuntu0.1~esm1 (Ubuntu Pro) | UBUNTU-CVE-2022-46175 |
| Debian 14 | node-json5 | Fixed | 2.2.3+dfsg-1 | DEBIAN-CVE-2022-46175 |
| Debian 13 | node-json5 | Fixed | 2.2.3+dfsg-1 | DEBIAN-CVE-2022-46175 |
| Debian 12 | node-json5 | Fixed | 2.2.3+dfsg-1 | DEBIAN-CVE-2022-46175 |
| Red Hat Enterprise Linux 9 | gjs | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 9 | gjs-devel | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 9 | grafana | Not affected | ||
| Red Hat Enterprise Linux 9 | grafana-selinux | Not affected | ||
| Red Hat Enterprise Linux 9 | keylime-agent-rust | Not affected | ||
| Red Hat Enterprise Linux 9 | pcs | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 9 | pcs-snmp | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 9 | polkit | Not affected | ||
| Red Hat Enterprise Linux 9 | polkit-devel | Not affected | ||
| Red Hat Enterprise Linux 9 | polkit-docs | Not affected | ||
| Red Hat Enterprise Linux 9 | polkit-libs | Not affected | ||
| Red Hat Enterprise Linux 8 | 389-ds-base | Fix pending Affected | ||
| Red Hat Enterprise Linux 8 | 389-ds-base-devel | Fix pending Affected | ||
| Red Hat Enterprise Linux 8 | 389-ds-base-legacy-tools | Fix pending Affected | ||
| Red Hat Enterprise Linux 8 | 389-ds-base-libs | Fix pending Affected | ||
| Red Hat Enterprise Linux 8 | 389-ds-base-snmp | Fix pending Affected | ||
| Red Hat Enterprise Linux 8 | cockpit-389-ds | Fix pending Affected | ||
| Red Hat Enterprise Linux 8 | cockpit-podman | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-azure-monitor | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-cloudwatch | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-elasticsearch | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-graphite | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-influxdb | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-loki | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-mssql | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-mysql | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-opentsdb | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-postgres | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-prometheus | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-selinux | Not affected | ||
| Red Hat Enterprise Linux 8 | grafana-stackdriver | Not affected | ||
| Red Hat Enterprise Linux 8 | mozjs60 | Not affected | ||
| Red Hat Enterprise Linux 8 | mozjs60-devel | Not affected | ||
| Red Hat Enterprise Linux 8 | pcs | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 8 | pcs-snmp | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 8 | python3-lib389 | Fix pending Affected | ||
| Red Hat Enterprise Linux 7 | firefox | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | firefox | Will not fix Out of support scope | ||
| npm library | json5 | Fixed | 1.0.2 | GHSA-9c47-m6qq-7p4h |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- json5: affected: < 2.2.2
Vendor advisories:
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
References
- https://github.com/json5/json5/security/advisories/GHSA-9c47-m6qq-7p4h
- https://github.com/json5/json5/issues/199
- https://github.com/json5/json5/issues/295
- https://github.com/json5/json5/pull/298
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3S26TLPLVFAJTUN3VIXFDEBEXDYO22CE/
- https://lists.debian.org/debian-lts-announce/2023/11/msg00021.html
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.