# CVE-2024-47764: cookie accepts cookie name, path, and domain with out of bounds characters


- **Severity:** Medium 6.9 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Fix available:** Yes
- **Published:** 4 Oct 2024
- **Updated:** 4 Oct 2024
- **Also known as:** AZL-50067, AZL-50073, AZL-50085, AZL-50094, AZL-50114, CLEANSTART-2026-NQ54168, CLSA-2026-1773879462, CLSA-2026-1773879464, CLSA-2026-1773879466, CLSA-2026-1773879467, CLSA-2026-1774052366, CLSA-2026-1777336757, CLSA-2026-1780447837, CLSA-2026-1780447838, CLSA-2026-1790965371, CLSA-2026-1792573061, DEBIAN-CVE-2024-47764, GHSA-pxg6-pf52-xh8x, MINI-jj3m-4m39-28r4, MINI-q2wx-qcvg-pf4w, ROOT-APP-NPM-CVE-2024-47764, UBUNTU-CVE-2024-47764

## What is CVE-2024-47764?

CVE-2024-47764 is a medium-severity vulnerability in jshttp cookie, published on 4 Oct 2024. 

### Official description

cookie is a basic HTTP cookie parser and serializer for HTTP servers. The cookie name could be used to set other fields of the cookie, resulting in an unexpected cookie value. A similar escape can be used for path and domain, which could be abused to alter other fields of the cookie. Upgrade to 0.7.0, which updates the validation for name, path, and domain.

Weakness: CWE-74 (Improper Neutralization of Special Elements in Output Used by a Downstream Component)

## Which versions are affected by CVE-2024-47764?

2 open source packages ship an affected version, including cookie.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `cookie` | npm | All versions | 0.7.0 |
| `cookie` | npm | All versions | 0.7.0 |

## How do I fix CVE-2024-47764?

Upgrade cookie to 0.7.0 or later.

## Is CVE-2024-47764 being exploited?

There is no known exploitation of CVE-2024-47764 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-47764 and fix it if it is affected.

What it is: CVE-2024-47764 is a medium-severity vulnerability in jshttp cookie, published on 4 Oct 2024. 
Exploitation: There is no known exploitation of CVE-2024-47764 in the wild and no public exploit code.

Affected packages and fixed versions:
- cookie (npm): affected all versions; fixed in 0.7.0
- cookie (npm): affected all versions; fixed in 0.7.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-47764/ (Markdown: https://insights.sbomify.com/CVE-2024-47764/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-47764
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-47764
- OSV: https://osv.dev/vulnerability/CVE-2024-47764

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-47764/
Summaries are generated and may contain mistakes; the official description above is the record.
