Starlette: Unvalidated request path concatenated into authority poisons request.url.hostname
Kludex starlette
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| starlette PyPI |
|
|
Original description
Starlette is a lightweight ASGI framework/toolkit. Prior to 1.3.0, the HTTP request path is not validated before being used to reconstruct request.url. Because request.url is rebuilt by concatenating {scheme}://{host}{path} and re-parsing the result, a path that does not begin with / (for example @google.com) moves the authority boundary during re-parsing, so request.url.hostname and request.url.netloc become attacker-controlled. Code that reads request.url.hostname (rather than the Host header or scope) can therefore be misled into trusting an attacker-supplied host. This vulnerability is fixed in 1.3.0.
From the CVE record · GitHub_M