JavaScript Cookie: Per-instance prototype hijack in assign() enables cookie-attribute injection (js-cookie js-cookie)
At a glance
- Source
- NVD
- EPSS
- EPSS 0.92 % · percentile 60 ()
- State
- PUBLISHED
- Published
- Updated
- Assigner
- GitHub_M
- NVD status
- Modified
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.
Weaknesses (CWE)
- CWE-1321 — Improperly Controlled Modification of Object Prototype Attributes
- CWE-915 — Improperly Controlled Modification of Dynamically-Determined Object Attributes
References
- https://github.com/js-cookie/js-cookie/security/advisories/GHSA-qjx8-664m-686j
- https://github.com/js-cookie/js-cookie/commit/eb3c40e89731e99b8970faaf35ddad249c6c0020
- https://github.com/js-cookie/js-cookie/releases/tag/v3.0.7
- https://access.redhat.com/security/cve/CVE-2026-46625
- https://bugzilla.redhat.com/show_bug.cgi?id=2487740
- https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-46625.json
- https://access.redhat.com/errata/RHSA-2026:48151
- https://access.redhat.com/errata/RHSA-2026:36625
- https://access.redhat.com/errata/RHSA-2026:56338
- https://access.redhat.com/errata/RHSA-2026:56357
- https://access.redhat.com/errata/RHSA-2026:59153
- https://access.redhat.com/errata/RHSA-2026:48126
- https://access.redhat.com/errata/RHSA-2026:49642
- https://access.redhat.com/errata/RHSA-2026:52768
- https://access.redhat.com/errata/RHSA-2026:60520
- https://access.redhat.com/errata/RHSA-2026:33183
Scores
| Version | Score | Vector | Scored by |
|---|---|---|---|
| CVSS 3.1 | HIGH 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N | GitHub_M |
| CVSS 3.1 | HIGH 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N | redhat-SADP |
| CVSS 3.1 | HIGH 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N | NVD · security-advisories@github.com (Secondary) |
| CVSS 3.1 | HIGH 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N | NVD · 0b0ca135-0b70-47e7-9f44-1890c2a1c46c (Secondary) |
Advisories
- GHSA-qjx8-664m-686j — JavaScript Cookie: Per-instance prototype hijack in assign() enables cookie-attribute injection
European references
- ENISA EUVD · EUVD-2026-36154
- GCVE · GCVE-0-2026-46625
CERT-FR advisories
- CERTFR-2026-AVI-1094 — Multiples vulnérabilités dans les produits IBM · cert.ssi.gouv.fr
- CERTFR-2026-AVI-0934 — Multiples vulnérabilités dans les produits Atlassian · cert.ssi.gouv.fr
Affected configurations (NVD CPE)
cpe:2.3:a:js-cookie:javascript_cookie:*:*:*:*:*:node.js:*:*< 3.0.7cpe:2.3:a:redhat:3scale_api_management:2.0:*:*:*:*:*:*:*cpe:2.3:a:redhat:ansible_automation_platform:2.0:*:*:*:*:*:*:*cpe:2.3:a:redhat:openshift_ai:-:*:*:*:*:*:*:*cpe:2.3:a:redhat:openshift_lightspeed:-:*:*:*:*:*:*:*cpe:2.3:o:redhat:enterprise_linux:8.0:*:*:*:*:*:*:*cpe:2.3:o:redhat:enterprise_linux:9.0:*:*:*:*:*:*:*cpe:2.3:o:redhat:enterprise_linux:10.0:*:*:*:*:*:*:*
Affected products
| Product | Versions |
|---|---|
| js-cookie · js-cookie | affected < 3.0.7 |
Sources
| Source | Licence |
|---|---|
| CVE List (CVEProject cvelistV5) | CVE Program Terms of Use |
| EPSS (FIRST.org) | FIRST — attribution requested |
| ENISA EUVD | ENISA — reproduction authorised, source acknowledged |
| CERT-FR (ANSSI) | Licence Ouverte / Etalab 2.0 |
| NVD (NIST) via fkie-cad/nvd-json-data-feeds | Public domain — this product uses data from the NVD API but is not endorsed or certified by the NVD |