Prototype Pollution
Description
The json-ptr npm package is vulnerable to prototype pollution via the set() operation with force flag enabled, allowing attackers to pollute Object.prototype.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
The json-ptr npm package is vulnerable to prototype pollution via the set() operation with force flag enabled, allowing attackers to pollute Object.prototype.
CVE-2020-7766 is a prototype pollution vulnerability in the json-ptr JavaScript package affecting all versions [1][3]. The flaw resides in the set() method when the force flag is set to true; the function recursively sets properties on the target object without proper validation of the key being set, enabling pollution of Object.prototype [1].
An attacker can exploit this by crafting a JSON pointer that includes prototype keys like __proto__ or constructor, causing the recursive property assignment to modify the global prototype chain [2][3]. No authentication is required if the attacker can supply input to the set() function, such as in applications that parse user-supplied JSON pointers with force mode enabled.
This can lead to denial of service, property injection, or potentially remote code execution if the polluted properties affect application logic [2][3]. The vulnerability has been addressed in a pull request [4] but the repository is archived and may no longer receive updates; users should switch to maintained alternatives or avoid using force flag with untrusted input.
AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
json-ptrnpm | < 2.1.0 | 2.1.0 |
Affected products
2- json-ptr/json-ptrdescription
Patches
12539e3494c80Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
9- github.com/advisories/GHSA-x5r6-x823-9848ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2020-7766ghsaADVISORY
- github.com/418sec/json-ptr/pull/3ghsaWEB
- github.com/flitbit/json-ptr/blob/master/src/util.ts%23L174ghsax_refsource_MISCWEB
- github.com/flitbit/json-ptr/commit/2539e3494c80af1eef24f0f433654a61f255f011ghsaWEB
- snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-1038396ghsax_refsource_MISCWEB
- snyk.io/vuln/SNYK-JS-JSONPTR-1016939ghsax_refsource_MISCWEB
- www.huntr.dev/bounties/2-npm-json-ptrghsaWEB
- www.npmjs.com/package/json-ptrghsaWEB
News mentions
0No linked articles in our index yet.