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: Regular Expression Denial of Service (ReDoS) via Cookie Name Injection - CVE-2026-44496
- Unhead has XSS bypass in `useHeadSafe` via attribute name injection and case-sensitive protocol check - CVE-2026-31860
- Trix: Stored XSS via HTMLParser attribute injection on paste - CVE-2026-73428
- 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 June 11, 2026


