{"id":"GHSA-pxg6-pf52-xh8x","summary":"cookie accepts cookie name, path, and domain with out of bounds characters","details":"### Impact\n\nThe cookie name could be used to set other fields of the cookie, resulting in an unexpected cookie value. For example, `serialize(\"userName=\u003cscript\u003ealert('XSS3')\u003c/script\u003e; Max-Age=2592000; a\", value)` would result in `\"userName=\u003cscript\u003ealert('XSS3')\u003c/script\u003e; Max-Age=2592000; a=test\"`, setting `userName` cookie to `\u003cscript\u003e` and ignoring `value`.\n\nA similar escape can be used for `path` and `domain`, which could be abused to alter other fields of the cookie.\n\n### Patches\n\nUpgrade to 0.7.0, which updates the validation for `name`, `path`, and `domain`.\n\n### Workarounds\n\nAvoid passing untrusted or arbitrary values for these fields, ensure they are set by the application instead of user input.\n\n### References\n\n* https://github.com/jshttp/cookie/pull/167","aliases":["CVE-2024-47764"],"modified":"2026-02-04T03:19:35.420344Z","published":"2024-10-04T20:31:00Z","related":["CGA-83ph-66p4-qvqj"],"database_specific":{"cwe_ids":["CWE-74"],"github_reviewed_at":"2024-10-04T20:31:00Z","github_reviewed":true,"nvd_published_at":null,"severity":"LOW"},"references":[{"type":"WEB","url":"https://github.com/jshttp/cookie/security/advisories/GHSA-pxg6-pf52-xh8x"},{"type":"WEB","url":"https://github.com/jshttp/cookie/pull/167"},{"type":"WEB","url":"https://github.com/jshttp/cookie/commit/e10042845354fea83bd8f34af72475eed1dadf5c"},{"type":"PACKAGE","url":"https://github.com/jshttp/cookie"}],"affected":[{"package":{"name":"cookie","ecosystem":"npm","purl":"pkg:npm/cookie"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.7.0"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/10/GHSA-pxg6-pf52-xh8x/GHSA-pxg6-pf52-xh8x.json"}}],"schema_version":"1.7.3"}