CVEfocus › CVE database › CVE-2022-46175

CVE-2022-46175

CVSS 7.1 HighEPSS 4.5% (higher than 92% of CVEs)Published 2022-12-24Updated 2024-08-03Assigner: GitHub_M

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.

CWE-1321

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

5Fixed
9Fix pending
8Will not fix
27Not affected

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.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 26.04node-json5Not affected
vulnerable_code_not_present
Ubuntu 25.10node-json5Not affected
vulnerable_code_not_present
Ubuntu 24.04node-json5Not affected
vulnerable_code_not_present
Ubuntu 22.04node-json5Fix pending2.2.0+dfsg-1ubuntu0.1~esm1 (Ubuntu Pro)UBUNTU-CVE-2022-46175
Ubuntu 20.04node-json5Fixed0.5.1-3ubuntu0.1UBUNTU-CVE-2022-46175
Ubuntu 18.04node-json5Fix pending0.5.1-1ubuntu0.1~esm1 (Ubuntu Pro)UBUNTU-CVE-2022-46175
Debian 14node-json5Fixed2.2.3+dfsg-1DEBIAN-CVE-2022-46175
Debian 13node-json5Fixed2.2.3+dfsg-1DEBIAN-CVE-2022-46175
Debian 12node-json5Fixed2.2.3+dfsg-1DEBIAN-CVE-2022-46175
Red Hat Enterprise Linux 9gjsWill not fix
Will not fix
Red Hat Enterprise Linux 9gjs-develWill not fix
Will not fix
Red Hat Enterprise Linux 9grafanaNot affected
Red Hat Enterprise Linux 9grafana-selinuxNot affected
Red Hat Enterprise Linux 9keylime-agent-rustNot affected
Red Hat Enterprise Linux 9pcsWill not fix
Will not fix
Red Hat Enterprise Linux 9pcs-snmpWill not fix
Will not fix
Red Hat Enterprise Linux 9polkitNot affected
Red Hat Enterprise Linux 9polkit-develNot affected
Red Hat Enterprise Linux 9polkit-docsNot affected
Red Hat Enterprise Linux 9polkit-libsNot affected
Red Hat Enterprise Linux 8389-ds-baseFix pending
Affected
Red Hat Enterprise Linux 8389-ds-base-develFix pending
Affected
Red Hat Enterprise Linux 8389-ds-base-legacy-toolsFix pending
Affected
Red Hat Enterprise Linux 8389-ds-base-libsFix pending
Affected
Red Hat Enterprise Linux 8389-ds-base-snmpFix pending
Affected
Red Hat Enterprise Linux 8cockpit-389-dsFix pending
Affected
Red Hat Enterprise Linux 8cockpit-podmanNot affected
Red Hat Enterprise Linux 8grafanaNot affected
Red Hat Enterprise Linux 8grafana-azure-monitorNot affected
Red Hat Enterprise Linux 8grafana-cloudwatchNot affected
Red Hat Enterprise Linux 8grafana-elasticsearchNot affected
Red Hat Enterprise Linux 8grafana-graphiteNot affected
Red Hat Enterprise Linux 8grafana-influxdbNot affected
Red Hat Enterprise Linux 8grafana-lokiNot affected
Red Hat Enterprise Linux 8grafana-mssqlNot affected
Red Hat Enterprise Linux 8grafana-mysqlNot affected
Red Hat Enterprise Linux 8grafana-opentsdbNot affected
Red Hat Enterprise Linux 8grafana-postgresNot affected
Red Hat Enterprise Linux 8grafana-prometheusNot affected
Red Hat Enterprise Linux 8grafana-selinuxNot affected
Red Hat Enterprise Linux 8grafana-stackdriverNot affected
Red Hat Enterprise Linux 8mozjs60Not affected
Red Hat Enterprise Linux 8mozjs60-develNot affected
Red Hat Enterprise Linux 8pcsWill not fix
Will not fix
Red Hat Enterprise Linux 8pcs-snmpWill not fix
Will not fix
Red Hat Enterprise Linux 8python3-lib389Fix pending
Affected
Red Hat Enterprise Linux 7firefoxWill not fix
Out of support scope
Red Hat Enterprise Linux 6firefoxWill not fix
Out of support scope
npm libraryjson5Fixed1.0.2GHSA-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.

Vendor advisories:

References

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.