Vulnerability · Published Aug 3, 2026 · Assigned by GitHub_M

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

Medium 5.9

In plain English

A medium-severity security flaw in litestar from litestar-org. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.4% (higher than 32% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)5.9Medium
Exploit odds (30 days)0.4%top 68.3% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

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.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
PyPIlitestar2.22.0GHSA-3qmc-cj7q-62hv
PyPIlitestar2.22.0PYSEC-2026-2603

Affected products (as reported)

VendorProductVersions
litestar-org litestar < 2.22.0

Weakness: CWE-644 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N

References