# CVE-2023-23934: Wrkzeug's incorrect parsing of nameless cookies leads to __Host- cookies bypass

> Attackers can bypass __Host- cookie security restrictions via nameless cookies, allowing session fixation or hijacking in Werkzeug applications.

- **Severity:** Low 2.6 (`CVSS:3.1/AV:A/AC:H/PR:N/UI:R/S:U/C:N/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 14 Feb 2023
- **Updated:** 10 Mar 2025
- **Also known as:** AZL-13589, CLSA-2026-1772410266, DEBIAN-CVE-2023-23934, GHSA-px8h-6qxv-m22q, PYSEC-2023-57, UBUNTU-CVE-2023-23934

## What is CVE-2023-23934?

CVE-2023-23934 is a low-severity vulnerability in pallets werkzeug, published on 14 Feb 2023. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

Werkzeug is a comprehensive WSGI web application library. Browsers may allow "nameless" cookies that look like `=value` instead of `key=value`. A vulnerable browser may allow a compromised application on an adjacent subdomain to exploit this to set a cookie like `=__Host-test=bad` for another subdomain. Werkzeug prior to 2.2.3 will parse the cookie `=__Host-test=bad` as __Host-test=bad`. If a Werkzeug application is running next to a vulnerable or malicious subdomain which sets such a cookie using a vulnerable browser, the Werkzeug application will see the bad cookie value but the valid cookie key. The issue is fixed in Werkzeug 2.2.3.

Weakness: CWE-20 (Improper Input Validation)

## Which versions are affected by CVE-2023-23934?

3 open source packages ship an affected version, including werkzeug and Werkzeug. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `werkzeug` | PyPI | All versions | 2.2.3 |
| `werkzeug` | PyPI | All versions | 2.2.3 |
| `Werkzeug` | PyPI | All versions | 2.2.3 |

Products: Palletsprojects Werkzeug.

## How do I fix CVE-2023-23934?

Upgrade werkzeug to 2.2.3 or later.

## Is CVE-2023-23934 being exploited?

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

## Other vulnerabilities in pallets werkzeug

- [CVE-2022-29361](https://insights.sbomify.com/CVE-2022-29361/): Other in n/a (critical 9.8)
- [CVE-2023-46136](https://insights.sbomify.com/CVE-2023-46136/): Werkzeug DoS: High resource usage when parsing multipart/form-data containing a large part with CR/LF character at the beginning (high 8.0)
- [CVE-2023-25577](https://insights.sbomify.com/CVE-2023-25577/): Werkzeug may allow high resource usage when parsing multipart form data with many fields (high 7.5)
- [CVE-2019-14322](https://insights.sbomify.com/CVE-2019-14322/): Pallets Werkzeug vulnerable to Path Traversal (high 7.5)
- [CVE-2026-27199](https://insights.sbomify.com/CVE-2026-27199/): Werkzeug safe_join() allows Windows special device names (medium 6.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-23934 and fix it if it is affected.

What it is: CVE-2023-23934 is a low-severity vulnerability in pallets werkzeug, published on 14 Feb 2023. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2023-23934 in the wild and no public exploit code.

Affected packages and fixed versions:
- werkzeug (PyPI): affected all versions; fixed in 2.2.3
- werkzeug (PyPI): affected all versions; fixed in 2.2.3
- Werkzeug (PyPI): affected all versions; fixed in 2.2.3

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-2023-23934/ (Markdown: https://insights.sbomify.com/CVE-2023-23934/index.md)
```

## Sources

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

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