Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
📦
📦 npm
Not in CISA KEV
HIGH severity

CVE-2022-46175 — json5

HIGHFix: json5/json5#298

CVE-2022-46175 is a high-severity (CVSS 7.1) CWE-1321 vulnerability in json5. 1 public exploit reference exists, so weaponization risk is real. A fix is available for json5 — see the affected versions and patch details below.

Prototype Pollution in JSON5 via Parse Method

Also known asGHSA-9c47-m6qq-7p4h
Published
Updated
Affected
2 pkgs
Patched
2 / 2
Exploits
1 known
Exploitation data as of Oct 21, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

EPSS Exploitation Probability

via FIRST.org ↗
9.2%probability of exploitation in next 30 days
Lower Risk+0.37%
Lower risk than most CVEs95th percentile — riskier than 95% of all scored CVEsHighest risk
0.00%19.3%38.5%57.8%46.5%9.2%Apr 26Aug 26Oct 26

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

CVE-2022-46175 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.

Where this sits among everything scored

Of 394,415 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.

Real-World Exposure

2 pkgs affected

How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.

7Kother npm packages depend on this — each one inherits the vulnerability until it's patched upstream
json5npm
144.7Mdownloads / week

Description

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.

Impact

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.

Mitigation

This vulnerability is patched in json5 v2.2.2 and later. A patch has also been backported for json5 v1 in versions v1.0.2 and later.

Details

Suppose a developer wants to allow users and admins to perform some risky operation, but they want to restrict what non-admins can do. To accomplish this, they accept a JSON blob from the user, parse it using JSON5.parse, confirm that the provided data does not set some sensitive keys, and then performs the risky operation using the validated data:

const JSON5 = require('json5');

const doSomethingDangerous = (props) => {
  if (props.isAdmin) {
    console.log('Doing dangerous thing as admin.');
  } else {
    console.log('Doing dangerous thing as user.');
  }
};

const secCheckKeysSet = (obj, searchKeys) => {
  let searchKeyFound = false;
  Object.keys(obj).forEach((key) => {
    if (searchKeys.indexOf(key) > -1) {
      searchKeyFound = true;
    }
  });
  return searchKeyFound;
};

const props = JSON5.parse('{"foo": "bar"}');
if (!secCheckKeysSet(props, ['isAdmin', 'isMod'])) {
  doSomethingDangerous(props); // "Doing dangerous thing as user."
} else {
  throw new Error('Forbidden...');
}

If the user attempts to set the isAdmin key, their request will be rejected:

const props = JSON5.parse('{"foo": "bar", "isAdmin": true}');
if (!secCheckKeysSet(props, ['isAdmin', 'isMod'])) {
  doSomethingDangerous(props);
} else {
  throw new Error('Forbidden...'); // Error: Forbidden...
}

However, users can instead set the __proto__ key to {"isAdmin": true}. JSON5 will parse this key and will set the isAdmin key on the prototype of the returned object, allowing the user to bypass the security check and run their request as an admin:

const props = JSON5.parse('{"foo": "bar", "__proto__": {"isAdmin": true}}');
if (!secCheckKeysSet(props, ['isAdmin', 'isMod'])) {
  doSomethingDangerous(props); // "Doing dangerous thing as admin."
} else {
  throw new Error('Forbidden...');
}

Affected Packages

2 total 2 fixed
EcosystemPackageVulnerable rangeFix
📦npmjson5≥ 2.0.0&&< 2.2.22.2.2npm install json5@2.2.2
📦npmjson5all versions1.0.2npm install json5@1.0.2

Affected Products

2 products · 3 configurations
OS
fedorafedoraproject
1 version
37
Application
json5json5
≥ 2.0.0 && < 2.2.2
range
Exploits & PoCs
1

Research use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for json5, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update json5 to 2.2.2 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2022-46175 is resolved across your whole dependency graph.

  3. Workarounds

    Escape or sanitise the affected output on the server side rather than relying on client-side filtering, and add a Content-Security-Policy that blocks inline script execution so injected markup cannot run even if it reaches the page.

Fixing This On Your OS

If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.

Red HatModerate

The json5 package is a build-time dependency in Red Hat products and is not used in production runtime. Hence, the impact is set to Moderate.

ProductFixed inAdvisory
MTA-6.0-RHEL-8mta/mta-ui-rhel8:6.0.1-10RHSA-2023:0934
Red Hat Migration Toolkit for Containers 1.7rhmtc/openshift-migration-ui-rhel8:v1.7.8-5RHSA-2023:1428
Red Hat OpenShift Dev Spaces 3 Containersdevspaces/dashboard-rhel8:3.15-6RHSA-2024:4631
Red Hat Single Sign-On 7json5RHSA-2023:1049
Red Hat Single Sign-On 7.6 for RHEL 7rh-sso7-keycloak-0:18.0.6-1.redhat_00001.1.el7ssoRHSA-2023:1043
Red Hat Single Sign-On 7.6 for RHEL 8rh-sso7-keycloak-0:18.0.6-1.redhat_00001.1.el8ssoRHSA-2023:1044
Red Hat Single Sign-On 7.6 for RHEL 9rh-sso7-keycloak-0:18.0.6-1.redhat_00001.1.el9ssoRHSA-2023:1045
RHEL-8 based Middleware Containersrh-sso-7/sso76-openshift-rhel8:7.6-20RHSA-2023:1047

Frequently Asked Questions

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. ## Impact This vulnerability could al
O3 Security · Impact-Aware SCA

Is CVE-2022-46175 in your dependencies?

Find it across npm, including transitive dependencies.

CVE-2022-46175: json5 RCE — Fixed in 2.2.2