BadHost – CVE-2026-48710: Starlette Host-Header Authentication Bypass Vulnerability
Key point
A security vulnerability has been discovered in which insufficient Host header handling in Starlette can allow authentication to be bypassed in major AI infrastructure such as vLLM and LiteLLM.
Details
CVE-2026-48710 has been reported, a vulnerability occurring in versions of Starlette below 1.0.1 where the Host header is used without validation when generating request.url.
An attacker can craft a manipulated Host header to generate a request.url.path that differs from the actual request path, thereby bypassing path-based authentication middleware. For example, if an attacker sends a header such as Host: example.com/health?x=, they can access the /protected path that requires authentication while the system recognizes it as the /health path.
Numerous FastAPI and Starlette-based AI infrastructures, including vLLM, LiteLLM, MCP servers, and AI agent frameworks, are exposed to this vulnerability. In particular, MCP servers may be especially vulnerable to attack due to their characteristic of using unauthenticated OAuth discovery endpoints.
Countermeasures:
- Update Starlette: Update to the latest version, 1.0.1 or higher, so that
Hostheaders containing invalid characters are ignored. - Improve authentication method: Instead of path-based authentication middleware, use security methods applied to the endpoint itself, such as FastAPI's
Depends()or Starlette'srequires(). - Introduce a reverse proxy: Place Nginx, Caddy, Traefik, etc. in front to validate and normalize the
Hostheader. - Modify code: In middleware, use
scope["path"], which cannot be manipulated, instead ofrequest.url.path.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.