{"schema_version":"1.9.0","id":"GHSA-pxg6-pf52-xh8x","published":"2024-10-04T20:31:00Z","modified":"2026-09-10T03:50:19.898971417Z","aliases":["CVE-2024-47764"],"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=<script>alert('XSS3')</script>; Max-Age=2592000; a\", value)` would result in `\"userName=<script>alert('XSS3')</script>; Max-Age=2592000; a=test\"`, setting `userName` cookie to `<script>` 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","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"}}],"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"}],"database_specific":{"cwe_ids":["CWE-74"],"github_reviewed":true,"github_reviewed_at":"2024-10-04T20:31:00Z","nvd_published_at":null,"severity":"LOW"}}