Executive brief
json-pointer is a JavaScript library used to parse and resolve JSON Pointer references in JSON documents. A prototype pollution vulnerability in versions up to 0.6.1 allows attackers to bypass security fixes by exploiting a type confusion issue when pointer components are arrays, potentially leading to object property injection and application logic manipulation.
Technical details
This is a prototype pollution vulnerability (CWE-1321, CWE-843) affecting json-pointer versions ≤0.6.1 that stems from inadequate type checking when processing pointer components. The vulnerability represents a bypass of the previous CVE-2020-7709 fix by exploiting a type confusion condition: when pointer components are arrays rather than strings or numbers, the vulnerable code fails to properly sanitize property names like "__proto__", "constructor", or "prototype". An attacker can craft malicious JSON pointers to inject properties into Object.prototype, potentially compromising the integrity of any object created or processed by the application. The attack requires network access but no authentication or user interaction. The fix was released in version 0.6.2 on February 17, 2022.
Affected products
- npm json-pointer 0 to 0.6.1
Timeline
- 2021-11-08: disclosed: GHSA advisory published
- 2021-11-03: advisory: NVD entry published
- 2022-02-17: patched: Fix merged in version 0.6.2