Skip to content
OpenAdvisories
High · 7.5 CVE-2026-46625 EUVD-2026-36154GHSA-qjx8-664m-686j

JavaScript Cookie: Per-instance prototype hijack in assign() enables cookie-attribute injection

Published Jun 10, 2026 · Updated Sep 9, 2026 · Assigned by GitHub_M

Description

JavaScript Cookie is a JavaScript API for handling cookies, client-side. Prior to version 3.0.7, 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 ({}). The result is a per-instance prototype hijack: Object.prototype itself is untouched, but the merged attributes object now inherits attacker-controlled keys. Because the consuming set() function then enumerates the merged object with another for...in, every key the attacker placed on the polluted prototype lands in the resulting Set-Cookie string as an attribute pair. The attacker can set domain=, secure=, samesite=, expires=, and path= on cookies whose attributes the developer thought were locked down. This issue has been patched in version 3.0.7.

Affected products

VendorProductAffectedFixed
js-cookie js-cookie < 3.0.7 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 node-js-cookie 3.0.7+~3.0.6-1 —
Debian 13 node-js-cookie No fix yet —
Debian 12 node-js-cookie No fix yet —
ReleasePackageFixed inAdvisory
Ubuntu 26.10 node-js-cookie No fix yet —
Ubuntu 26.04 LTS node-js-cookie No fix yet —
Ubuntu 25.10 node-js-cookie No fix yet —
Ubuntu 24.04 LTS node-js-cookie No fix yet —
Ubuntu 22.04 LTS node-js-cookie No fix yet —
Show 2 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu 20.04 LTS node-js-cookie No fix yet —
Ubuntu 18.04 LTS node-js-cookie No fix yet —

Wolfi

ReleasePackageFixed inAdvisory
Wolfi rolling opensearch-dashboards-3 3.6.0-r6 —
Wolfi rolling saf 1.6.0-r0 —

Affected packages

EcosystemPackageAffectedFixedRecord
npm js-cookie < 3.0.7 3.0.7 GHSA-qjx8-664m-686j

Advisories 5

References