# CVE-2022-4742: json-pointer prototype pollution

Source: https://junglewise.ai/threats/cve-2022-4742-json-pointer-prototype-pollution  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2022-12-26. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2022-4742 · Severity: low · CVSS 3.1 · Published 2022-12-26

json-pointer is a JavaScript library used to access and manipulate nested properties in JSON objects. This vulnerability allows an attacker to inject malicious properties into the core JavaScript object prototype, potentially affecting all objects in an application and leading to arbitrary code execution or complete application compromise.

Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2022-4742 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2022-4742 being exploited in the wild.

**How severe is CVE-2022-4742?** Low severity, with a CVSS score of 3.1, published 26 December 2022.

**Which products and versions are affected?** json-pointer (npm) SEMVER:introduced=0,fixed=0.6.2.

**Is there a fix for CVE-2022-4742?** Yes. json-pointer (npm): upgrade to 0.6.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2022-4742 attacked?** It is attacked over the network.

**Am I affected by CVE-2022-4742?** Check whether you run json-pointer (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- json-pointer (npm): upgrade to 0.6.2 or later

  ```sh
  npm install json-pointer@0.6.2
  ```


## Technical details

json-pointer versions up to 0.6.1 are vulnerable to prototype pollution through the `set()` function in index.js. The vulnerability occurs when the function fails to properly validate or sanitize pointer input before manipulating object properties, allowing an attacker to set properties on the Object prototype (e.g., via paths like "__proto__" or "constructor.prototype"). This is a remote network-based attack requiring no authentication or user interaction. An attacker can inject arbitrary properties into the shared prototype, which will be inherited by all objects in the application, potentially enabling code execution or application-wide manipulation. The issue is fixed in version 0.6.2 (commit 859c9984b6c407fc2d5a0a7e47c7274daa681941).

## Affected products

- manuelstofer json-pointer up to 0.6.1

## Identifiers

- CVE-2022-4742
- GHSA-6xrf-q977-5vgc

## Timeline

- 2022-12-26: disclosed: Published in GitHub advisory database
- 2022-02-17: patched: Fix merged in pull request #36, released in version 0.6.2
- 2021-11-11: other: Fix initially proposed

## References

- [https://github.com/manuelstofer/json-pointer/pull/36](https://github.com/manuelstofer/json-pointer/pull/36)

## Related threats

- [json-pointer prototype pollution vulnerability](https://junglewise.ai/threats/cve-2021-23820-json-pointer-prototype-pollution-vulnerability)
