JavaScript Cookie: Per-instance prototype hijack in assign() enables cookie-attribute injection
- Severity:
- High
Description
js-cookie’s internal assign() helper copies properties with for...in + plain assignment. When the source object is produced by JSON.parse, the JSON object’s "__proto__" member is an own enumerable property, so the for…in enumerates it and the target[key] = source[key] write triggers the Object.prototype.__proto__ setter on the fresh target ({}).
Recommendation
Update the js-cookie package to the latest compatible version. Followings are version details:
- Affected version(s): <= 3.0.5
- Patched version(s): 3.0.7
References
Related Issues
- Axios has prototype pollution read-side gadgets in HTTP adapter that allow credential injection and request hijacking - CVE-2026-42264
- jsPDF has a PDF Injection in AcroForm module allows Arbitrary JavaScript Execution (RadioButton.createOption and "AS" pr - CVE-2026-25940
- Svelte SSR attribute spreading includes inherited properties from prototype chain - CVE-2026-27125
- protobuf.js: Prototype injection in generated message constructors - CVE-2026-44292
You might also like:
- Tags:
- npm
- js-cookie
Anything's wrong? Let us know Last updated on May 21, 2026


