Junglewise Threat Intelligence

CVE-2022-4742: json-pointer prototype pollution

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

Technologies: Manuelstofer Json-Pointer.

Executive brief

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.

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

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