# CVE-2026-48061: Litestar: AllowedHostsMiddleware bypasses host validation via client-controlled X-Forwarded-Host header

> Attackers can bypass host validation in Litestar by spoofing the X-Forwarded-Host header, enabling password reset poisoning and cache poisoning attacks.

- **Severity:** Medium 5.9 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 3 Aug 2026
- **Updated:** 4 Aug 2026
- **Also known as:** GHSA-3qmc-cj7q-62hv, PYSEC-2026-2603

## What is CVE-2026-48061?

CVE-2026-48061 is a medium-severity vulnerability in litestar-org litestar, published on 3 Aug 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Litestar is an Asynchronous Server Gateway Interface (ASGI) framework. In versions prior to 2.22.0, an attacker can bypass the allowed hosts validation by omitting the Host header and supplying an X-Forwarded-Host header set to a whitelisted domain. The AllowedHostsMiddleware trusts the X-Forwarded-Host header as a fallback when the Host header is absent. Since X-Forwarded-Host is a client-controllable header, this enables host header injection attacks such as password reset poisoning, cache poisoning, and server-side request routing manipulation. Any application using AllowedHostsConfig is affected when deployed without a reverse proxy that strips X-Forwarded-Host, or when accepting HTTP/1.0 connections. This issue has been fixed in version 2.22.0.

Weakness: CWE-644 (Improper Neutralization of HTTP Headers for Scripting Syntax)

## Which versions are affected by CVE-2026-48061?

3 open source packages ship an affected version, including litestar.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `litestar` | PyPI | All versions | 2.22.0 |
| `litestar` | PyPI | All versions | 2.22.0 |
| `litestar` | PyPI | All versions | 2.22.0 |

## How do I fix CVE-2026-48061?

Upgrade litestar to 2.22.0 or later.

## Is CVE-2026-48061 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-48061 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-48061 and fix it if it is affected.

What it is: CVE-2026-48061 is a medium-severity vulnerability in litestar-org litestar, published on 3 Aug 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-48061 exists.

Affected packages and fixed versions:
- litestar (PyPI): affected all versions; fixed in 2.22.0
- litestar (PyPI): affected all versions; fixed in 2.22.0
- litestar (PyPI): affected all versions; fixed in 2.22.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-2026-48061/ (Markdown: https://insights.sbomify.com/CVE-2026-48061/index.md)
```

## Sources

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

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