Skip to content
MediumNews

FastAPI-based AI tools exposed to authentication bypass by flaw in Starlette framework

Published
Record updated
View JSON

Summary

A single malformed character in the Host header lets an unauthenticated attacker bypass host-validation protections in Starlette, the Python framework underlying FastAPI, tracked as CVE-2026-48710. Starlette rebuilds the request URL by joining the Host header to the path, and a slash, question mark or hash in the Host header shifts where the path begins, so middleware reads a different path than the one routed. Researchers at X41 D-Sec rated the flaw 7.0 (High), while Starlette's maintainer rated it 6.5 (Moderate), and they said downstream applications built on FastAPI, including AI model-serving tools, gateways and MCP servers, can be affected.