node-js-cookie — security advisory
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.
- Products
- node-js-cookie
- Affected versions
- 2.2.0-1, 2.2.0-2, 2.2.1-1, 2.2.1-2, 3.0.1+~3.0.0-2, 3.0.1+~3.0.0-3, 3.0.7+~3.0.6-2, 3.0.8+~3.0.6-1
- Fixed versions
- Not specified
- CVEs
- CVE-2026-46625
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 31 Oct 2026, 02:17 UTC · Revision 1
Source evidence
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.
osv:UBUNTU-CVE-2026-46625
node-js-cookie
Fixed versions: Not specified
node-js-cookie
Fixed versions: Not specified
node-js-cookie
Fixed versions: Not specified
node-js-cookie
Fixed versions: Not specified
node-js-cookie
Fixed versions: Not specified
node-js-cookie
Fixed versions: Not specified
node-js-cookie
Fixed versions: Not specified
Complete source record
{
"id": "3c9811114b92833d7de8d516fe38d060c9fdb4deafd2c77a8477619e109bc46e",
"url": "https://osv.dev/vulnerability/UBUNTU-CVE-2026-46625",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "UBUNTU-CVE-2026-46625",
"summary": "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.",
"evidence": "osv:UBUNTU-CVE-2026-46625",
"products": [
{
"name": {
"value": "node-js-cookie",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "2.2.0-1",
"evidence": "/affected/0/versions"
}
]
},
{
"name": {
"value": "node-js-cookie",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "2.2.0-2",
"evidence": "/affected/1/versions"
},
{
"value": "2.2.1-1",
"evidence": "/affected/1/versions"
}
]
},
{
"name": {
"value": "node-js-cookie",
"evidence": "/affected/2/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "2.2.1-1",
"evidence": "/affected/2/versions"
},
{
"value": "2.2.1-2",
"evidence": "/affected/2/versions"
},
{
"value": "3.0.1+~3.0.0-2",
"evidence": "/affected/2/versions"
}
]
},
{
"name": {
"value": "node-js-cookie",
"evidence": "/affected/3/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "3.0.1+~3.0.0-3",
"evidence": "/affected/3/versions"
}
]
},
{
"name": {
"value": "node-js-cookie",
"evidence": "/affected/4/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "3.0.1+~3.0.0-3",
"evidence": "/affected/4/versions"
}
]
},
{
"name": {
"value": "node-js-cookie",
"evidence": "/affected/5/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "3.0.1+~3.0.0-3",
"evidence": "/affected/5/versions"
},
{
"value": "3.0.7+~3.0.6-2",
"evidence": "/affected/5/versions"
},
{
"value": "3.0.8+~3.0.6-1",
"evidence": "/affected/5/versions"
}
]
},
{
"name": {
"value": "node-js-cookie",
"evidence": "/affected/6/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "3.0.1+~3.0.0-3",
"evidence": "/affected/6/versions"
}
]
}
],
"severity": "high",
"structured": {
"id": "UBUNTU-CVE-2026-46625",
"aliases": [
"UBUNTU-CVE-2026-46625"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
},
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
},
{
"type": "Ubuntu",
"score": "medium"
}
],
"affected": [
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "node-js-cookie",
"purl": "pkg:deb/ubuntu/node-js-cookie?arch=source&distro=bionic",
"ecosystem": "Ubuntu:18.04:LTS"
},
"versions": [
"2.2.0-1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-46625.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "node-js-cookie",
"binary_version": "2.2.0-1"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "node-js-cookie",
"purl": "pkg:deb/ubuntu/node-js-cookie?arch=source&distro=focal",
"ecosystem": "Ubuntu:20.04:LTS"
},
"versions": [
"2.2.0-2",
"2.2.1-1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-46625.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "node-js-cookie",
"binary_version": "2.2.1-1"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "node-js-cookie",
"purl": "pkg:deb/ubuntu/node-js-cookie?arch=source&distro=jammy",
"ecosystem": "Ubuntu:22.04:LTS"
},
"versions": [
"2.2.1-1",
"2.2.1-2",
"3.0.1+~3.0.0-2"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-46625.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "node-js-cookie",
"binary_version": "3.0.1+~3.0.0-2"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "node-js-cookie",
"purl": "pkg:deb/ubuntu/node-js-cookie?arch=source&distro=noble",
"ecosystem": "Ubuntu:24.04:LTS"
},
"versions": [
"3.0.1+~3.0.0-3"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-46625.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "node-js-cookie",
"binary_version": "3.0.1+~3.0.0-3"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "node-js-cookie",
"purl": "pkg:deb/ubuntu/node-js-cookie?arch=source&distro=questing",
"ecosystem": "Ubuntu:25.10"
},
"versions": [
"3.0.1+~3.0.0-3"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-46625.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "node-js-cookie",
"binary_version": "3.0.1+~3.0.0-3"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "node-js-cookie",
"purl": "pkg:deb/ubuntu/node-js-cookie?arch=source&distro=stonking",
"ecosystem": "Ubuntu:26.10"
},
"versions": [
"3.0.1+~3.0.0-3",
"3.0.7+~3.0.6-2",
"3.0.8+~3.0.6-1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-46625.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "node-js-cookie",
"binary_version": "3.0.8+~3.0.6-1"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "node-js-cookie",
"purl": "pkg:deb/ubuntu/node-js-cookie?arch=source&distro=resolute",
"ecosystem": "Ubuntu:26.04:LTS"
},
"versions": [
"3.0.1+~3.0.0-3"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-46625.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "node-js-cookie",
"binary_version": "3.0.1+~3.0.0-3"
}
]
}
}
],
"modified": "2026-10-17T12:58:24.946496902Z",
"provider": "osv",
"upstream": [
"CVE-2026-46625"
],
"references": [
"https://ubuntu.com/security/CVE-2026-46625",
"https://www.cve.org/CVERecord?id=CVE-2026-46625",
"https://github.com/js-cookie/js-cookie/commit/eb3c40e89731e99b8970faaf35ddad249c6c0020",
"https://github.com/js-cookie/js-cookie/releases/tag/v3.0.7",
"https://github.com/js-cookie/js-cookie/security/advisories/GHSA-qjx8-664m-686j"
]
},
"related_cves": [
{
"value": "CVE-2026-46625",
"evidence": "/upstream"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 358659,
"published_at": "2026-06-10T22:16:00+00:00"
}