Skip to content
Discussion options

You must be logged in to vote

Hi @ftnext — your analysis is correct.
Since FastAPI delegates all Request / request.url handling to Starlette, any FastAPI application running on Starlette ≤ 1.0.0 is exposed to the same issue described in GHSA-86qp-5c8j-p5mr (CVE-2026-48710).
Root cause (from the advisory): Affected versions reconstruct request.url by concatenating http://{host}{path} and re-parsing the result. When the Host header contains characters invalid per RFC 9112 §3.2 — such as /, ?, or # — the re-parsing shifts the path/query boundaries. This means request.url.path can return a different value than the path the router actually dispatched to. Your example reproduces this exactly: the request is routed to /foo, …

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@ftnext
Comment options

Answer selected by ftnext

This comment was marked as spam.

Comment options

You must be logged in to vote
1 reply
@YuriiMotov
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or problem
5 participants