Skip to content
OpenAdvisories
Medium · 5.9 CVE-2026-48061 EUVD-2026-52437GHSA-3qmc-cj7q-62hvPYSEC-2026-2603

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

Published Aug 3, 2026 · Updated Aug 4, 2026 · Assigned by GitHub_M

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 products

VendorProductAffectedFixed
litestar-org litestar < 2.22.0 —

Affected packages

EcosystemPackageAffectedFixedRecord
PyPI litestar < 2.22.0 2.22.0 GHSA-3qmc-cj7q-62hv

References