PYSEC-2026-161
BadHost: Missing Host header validation poisons request.url.path, bypassing path-based security checks
En bref
- Publiée
- Mise à jour
- CVE
- CVE-2026-48710
- Alias
- GHSA-86qp-5c8j-p5mr, X41-2026-002
Description
Starlette reconstructs the requested URL based on the HTTP Host request header and requested path, but does not perform any validation of the Host header value. This allows attackers to inject paths into the host part, prepending the actual path. However, routing in Starlette is based on the actual request path. This inconsistent interpretation of HTTP requests may lead to issues such as authentication bypass when the authentication depends on the reconstructed URL’s path.
Paquets affectés
| Paquet | Versions |
|---|---|
| PyPI · starlette | introduced 0, fixed 1.0.1 |
Références
- https://badhost.org ARTICLE
- https://www.secwest.net/starlette ARTICLE
- https://ostif.org/disclosing-the-badhost-vulnerability-in-starlette/ ARTICLE
- https://badhost.org DETECTION
- https://github.com/Kludex/starlette/security/advisories/GHSA-86qp-5c8j-p5mr EVIDENCE
- https://github.com/Kludex/starlette/security/advisories/GHSA-86qp-5c8j-p5mr ADVISORY
- https://www.x41-dsec.de/lab/advisories/x41-2026-002-starlette/ ADVISORY
- https://github.com/Kludex/starlette/commit/764dab0dcfb9033d75442d7a359645c9f94648c6 FIX
Sources
| Source | Licence |
|---|---|
| OSV.dev | CC-BY 4.0 — PyPA Advisory Database |