CVE-2026-46625: JavaScript Cookie: Per-instance prototype hijack in assign() enables cookie-attribute injection
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.
Vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N · CWE-1321
Tracked companies
Mapped from the CVE’s affected-product data, NVD CPE matches, vendor advisories or package feeds. A mapping means the vendor’s software is named, not that its hosted service was exposed.
Status incidents that name it
No tracked status incident names this CVE.
Affected vendors and products
js-cookie: js-cookieRed Hat: Cryostat 4 on RHEL 9Red Hat: OpenShift LightspeedRed Hat: Red Hat 3scale API Management Platform 2Red Hat: Red Hat Advanced Cluster Security for Kubernetes 4.10Red Hat: Red Hat Ansible Automation Platform 2Red Hat: Red Hat Ansible Automation Platform 2.1Red Hat: Red Hat Ansible Automation Platform 2.2Red Hat: Red Hat Ansible Automation Platform 2.7Red Hat: Red Hat Developer Hub 1.10Red Hat: Red Hat Developer Hub 1.9Red Hat: Red Hat Discovery 2Red Hat: Red Hat Enterprise Linux 10Red Hat: Red Hat Enterprise Linux 8Red Hat: Red Hat Enterprise Linux 9Red Hat: Red Hat JBoss Enterprise Application Platform 7Red Hat: Red Hat JBoss Enterprise Application Platform 8Red Hat: Red Hat JBoss Enterprise Application Platform Expansion PackRed Hat: Red Hat OpenShift AI 3.4Red Hat: Red Hat OpenShift AI (RHOAI)Red Hat: Red Hat OpenShift Container Platform 4Red Hat: Red Hat OpenShift Service Mesh 3.3
References
- CVE record on cve.org (opens in new tab)
- NVD entry (opens in new tab)
- github.com/js-cookie/js-cookie/commit/eb3c40e89731e99b8970faaf35ddad249c6c0020 (opens in new tab)
- github.com/js-cookie/js-cookie/releases/tag/v3.0.7 (opens in new tab)
- github.com/js-cookie/js-cookie/security/advisories/GHSA-qjx8-664m-686j (opens in new tab)
- CVE records from the CVE Program (cve.org). CVE® is a registered trademark of The MITRE Corporation. (opens in new tab)
- This product uses data from the NVD API but is not endorsed or certified by the NVD. (opens in new tab)
- Known Exploited Vulnerabilities catalog from CISA. (opens in new tab)
- EPSS scores from FIRST (Exploit Prediction Scoring System). (opens in new tab)