7.5High

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

js-cookie js-cookie; Red Hat Cryostat 4 on RHEL 9; Red Hat Red Hat Advanced Cluster Security for Kubernetes 4.10; Red Hat Red Hat Ansible Automation Platform 2.1 Published: (5 months ago)

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.

Weakness (CWE): CWE-1321CWE-915

Data: CVE.org, NVD, CISA KEV, FIRST EPSS, Ubuntu. Published as the sources state it, in English.

Affected products and versions

VendorProductVersions
advanced cluster security 4.10 —
ansible automation platform 2.7 —
cryostat 4 —
discovery 2 —
js-cookie javascript cookie < 3.0.7
js-cookie js-cookie < 3.0.7
openshift ai 3.4 —
redhat 3scale api management 2.0
redhat ansible automation platform 2.0
Red Hat Cryostat 4 on RHEL 9 all versions
redhat enterprise linux 8.0
redhat openshift ai —
Red Hat OpenShift Lightspeed all versions
Red Hat Red Hat 3scale API Management Platform 2 all versions
Red Hat Red Hat Advanced Cluster Security for Kubernetes 4.10 all versions
Red Hat Red Hat Ansible Automation Platform 2 all versions
Red Hat Red Hat Ansible Automation Platform 2.1 all versions
Red Hat Red Hat Ansible Automation Platform 2.2 all versions
Red Hat Red Hat Ansible Automation Platform 2.7 all versions
Red Hat Red Hat Developer Hub 1.10 all versions
Red Hat Red Hat Developer Hub 1.9 all versions
Red Hat Red Hat Discovery 2 —
Red Hat Red Hat Enterprise Linux 10 —
Red Hat Red Hat Enterprise Linux 8 all versions
Red Hat Red Hat Enterprise Linux 9 —
Red Hat Red Hat JBoss Enterprise Application Platform 7 all versions
Red Hat Red Hat JBoss Enterprise Application Platform 8 —
Red Hat Red Hat JBoss Enterprise Application Platform Expansion Pack —
Red Hat Red Hat OpenShift AI 3.4 all versions
Red Hat Red Hat OpenShift AI (RHOAI) all versions
Red Hat Red Hat OpenShift Container Platform 4 —
Red Hat Red Hat OpenShift Service Mesh 3.3 all versions
rhdh 1.10 —
rhdh 1.9 —
service mesh 3.3 —

References and patches

CPE matches (NVD) (8)

  • cpe:2.3:a:js-cookie:javascript_cookie:*:*:*:*:*:node.js:*:* < 3.0.7
  • cpe: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:*:*:*:*:*:*:*