Vulnerabilities/

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:

References

Related Issues

Tags:
npm
js-cookie
Anything's wrong? Let us know Last updated on May 21, 2026