Description
Starlette is a lightweight ASGI framework/toolkit. Prior to version 1.0.1, the HTTP `Host` request header was not validated before being used to reconstruct `request.url`. Because the routing algorithm relies on the raw HTTP path while `request.url` is rebuilt from the `Host` header, a malformed header could make `request.url.path` differ from the path that was actually requested. Middleware and endpoints that apply security restrictions based on `request.url` (rather than the raw `scope` path) could therefore be bypassed. Users should upgrade to a version greater than or equal to version 1.0.1, which validates the `Host` header against the grammar of RFC 9112 §3.2 / RFC 3986 §3.2.2 when constructing `request.url` and falls back to `scope["server"]` for malformed values.
Problem types
CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling')
Product status
References
github.com/...rlette/security/advisories/GHSA-86qp-5c8j-p5mr
github.com/...ommit/764dab0dcfb9033d75442d7a359645c9f94648c6
github.com/.../tree/main/vulns/starlette/PYSEC-2026-161.yaml
ostif.org/disclosing-the-badhost-vulnerability-in-starlette
www.x41-dsec.de/lab/advisories/x41-2026-002-starlette