GHSA-PXG6-PF52-XH8X
Vulnerability from github – Published: 2024-10-04 20:31 – Updated: 2024-10-04 20:31
VLAI?
Summary
cookie accepts cookie name, path, and domain with out of bounds characters
Details
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
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "cookie"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.7.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2024-47764"
],
"database_specific": {
"cwe_ids": [
"CWE-74"
],
"github_reviewed": true,
"github_reviewed_at": "2024-10-04T20:31:00Z",
"nvd_published_at": null,
"severity": "LOW"
},
"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(\u0027XSS3\u0027)\u003c/script\u003e; Max-Age=2592000; a\", value)` would result in `\"userName=\u003cscript\u003ealert(\u0027XSS3\u0027)\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",
"id": "GHSA-pxg6-pf52-xh8x",
"modified": "2024-10-04T20:31:00Z",
"published": "2024-10-04T20:31:00Z",
"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"
}
],
"schema_version": "1.4.0",
"severity": [],
"summary": "cookie accepts cookie name, path, and domain with out of bounds characters"
}
Loading…
Loading…
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Loading…
Loading…