First published: Fri Oct 04 2024(Updated: )
### Impact The 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`. A similar escape can be used for `path` and `domain`, which could be abused to alter other fields of the cookie. ### Patches Upgrade to 0.7.0, which updates the validation for `name`, `path`, and `domain`. ### Workarounds Avoid passing untrusted or arbitrary values for these fields, ensure they are set by the application instead of user input. ### References * https://github.com/jshttp/cookie/pull/167
Credit: security-advisories@github.com
Affected Software | Affected Version | How to fix |
---|---|---|
npm/cookie | <0.7.0 | 0.7.0 |
Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.
CVE-2024-47764 is classified as a high severity vulnerability due to the potential for cross-site scripting (XSS) exploits.
To fix CVE-2024-47764, update the cookie package to version 0.7.1 or later.
CVE-2024-47764 is a cross-site scripting (XSS) vulnerability related to cookie handling.
The vulnerability impacts the 'cookie' package version 0.7.0 and below from npm.
Exploitation of CVE-2024-47764 could allow attackers to manipulate cookie values, potentially leading to unauthorized actions or data theft.