CVE-2021-23509: Prototype Pollution in json-ptr
Summary
CVE-2021-23509: Prototype Pollution in json-ptr. Affects json-ptr versions < 3.0.0. Fixed in 3.0.0. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The json-ptr package is an npm package used for manipulating JSON data using JSON pointers. It provides functions to navigate and modify JSON objects based on the provided pointer. The package is widely used in JavaScript applications for handling JSON data.
Vulnerability Detail
A type confusion vulnerability exists in versions of json-ptr prior to 3.0.0. This vulnerability can lead to a bypass of CVE-2020-7766 when the user-provided keys used in the pointer parameter are arrays. An attacker can exploit this vulnerability to manipulate the JSON object and potentially execute arbitrary code or modify sensitive data. The vulnerability has a CVSS score of 5.6, indicating a moderate severity.
How To Fix
Latest published version: 3.1.1 as of 23 Oct 2026
npm install json-ptr@3.1.1
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
3.0.0
This is the first release that contains the fix.
npm install json-ptr@3.0.0
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
There is no known workaround for this vulnerability. It is recommended to upgrade to the fixed version of the json-ptr package.
Conclusion
In conclusion, the json-ptr package prior to version 3.0.0 is vulnerable to a type confusion vulnerability that can lead to a bypass of CVE-2020-7766. It is recommended to upgrade to version 3.0.0 or later to fix this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for json-ptr →
FAQ
This vulnerability allows an attacker to manipulate JSON objects and potentially execute arbitrary code or modify sensitive data.
You can use the Vulert Playground at Vulert Scanner to check if your application is affected by this vulnerability. Simply upload your package-lock.json file and Vulert will analyze it for any open-source vulnerabilities, including this one.
Yes, upgrading to version 3.0.0 or later of the json-ptr package fixes this vulnerability.
No, there are no known workarounds for this vulnerability. It is recommended to upgrade to the fixed version of the json-ptr package.
This vulnerability has a CVSS score of 5.6, indicating a moderate severity.
References
Related vulnerabilities
Recent vulnerabilities recorded for json-ptr.