CVE-2026-54282
JSON

3.7low

Starlette: Unvalidated request path concatenated into authority poisons request.url.hostname

Severity
3.7low CVSS:3.1 by GitHub_M
Exploit likelihood
0.19% (higher than 8% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-jp82-jpqv-5vv3PYSEC-2026-248

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.

Affected

Product or packageVersionsReported by
Kludex starlette< 1.3.0CVE List
starlette (PyPI)before 1.3.0GitHub Advisory Database, PyPA Advisory Database
encode starlettebefore 1.3.0NVD

All scores

GitHub_M3.7low CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N
GitHub3.7low CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N
NVD5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
PyPA Advisory Database5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N

Classification

CWE-20CWE-706

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

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.

GitHub Advisory Database
Summary

In affected versions, 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.

Details

When a client requests a path that does not start with /:

GET @google.com HTTP/1.1
Host: localhost

affected versions reconstruct the URL as http://localhost@google.com. Per RFC 3986 §3.2.1, the substring before @ in the authority is userinfo, so re-parsing yields username = "localhost" and hostname = "google.com", with an empty path:

request.url          == "http://localhost@google.com"
request.url.hostname == "google.com"
request.url.path     == ""

The root cause is that the path is concatenated directly after the host without a separating /, and without validating that it begins with one. Only the Host header was validated when constructing request.url; the path was not.

This requires an ASGI server that forwards a request-target lacking a leading / into scope["path"].

Impact

Any application running an affected version that uses request.url, request.url.netloc, or request.url.hostname for a security-sensitive decision (host-based authorization, redirect/callback base, SSRF target, cache key, audit log) may be affected, when no fronting proxy or load balancer rejects the malformed request-target first.

Note that this is less exploitable than GHSA-86qp-5c8j-p5mr: there, the poison is carried in the Host header, so the real path still routes to a valid endpoint while request.url.path lies. Here, the poison must be carried in the path itself, and that path (@google.com) does not match any registered route, so routing returns 404 and no endpoint handler runs. The exposure is limited to code that reads request.url before routing - notably middleware - or in 404/exception handlers.

Mitigation

Upgrade to a patched version, which prevents the request path from crossing into the URL authority. The request above instead yields http://localhost/@google.com with request.url.hostname == "localhost".

NVD (es)

Starlette es un framework/conjunto de herramientas ASGI ligero. Antes de la versión 1.3.0, la ruta de solicitud HTTP no se valida antes de ser utilizada para reconstruir request.url. Debido a que request.url se reconstruye concatenando {scheme}://{host}{path} y volviendo a analizar el resultado, una ruta que no comienza con / (por ejemplo, @google.com) mueve el límite de autoridad durante el reanálisis, por lo que request.url.hostname y request.url.netloc pasan a estar controlados por el atacante. El código que lee request.url.hostname (en lugar del encabezado Host o el ámbito) puede, por lo tanto, ser engañado para confiar en un host proporcionado por el atacante. Esta vulnerabilidad se corrige en la versión 1.3.0.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-54282 changed 2026-06-22CVE Terms of Use
GitHub Advisory DatabaseGHSA-jp82-jpqv-5vv3 changed 2026-09-10CC-BY-4.0
NVDCVE-2026-54282 changed 2026-10-25Public domain
PyPA Advisory DatabasePYSEC-2026-248 changed 2026-06-27CC-BY-4.0