IA Squad
SearchPT
python · StarletteHeads-up

Starlette: request.url hostname spoofing via malformed path

The HTTP request path is not validated before being used to reconstruct request.

16 Jun 2026Read 1 minSeverity: schedule it

What changed

The HTTP request path is not validated before being used to reconstruct request.url, allowing an attacker to control request.url.hostname and request.url.netloc by supplying a path that does not begin with '/' (e.g., @google.com).

Who it affects

Applications using Starlette that rely on request.url, request.url.netloc, or request.url.hostname for security-sensitive decisions (host-based authorization, redirect/callback base, SSRF target, cache key, audit log) and are not behind a fronting proxy or load balancer that rejects malformed request-targets.

What to do today

Upgrade to a patched version of Starlette that prevents the request path from crossing into the URL authority.

The trail
Collected Audited Written Published