{"id":"CVE-2026-54282","aliases":["CVE-2026-54282","GHSA-jp82-jpqv-5vv3","PYSEC-2026-248"],"related":[],"kind":"vulnerability","state":"published","title":"Starlette: Unvalidated request path concatenated into authority poisons request.url.hostname","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nIn 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.\n\n### Details\n\nWhen a client requests a path that does not start with `/`:\n\n```http\nGET @google.com HTTP/1.1\nHost: localhost\n```\n\naffected versions reconstruct the URL as `http://localhost@google.com`. Per [RFC 3986 §3.2.1](https://www.rfc-editor.org/rfc/rfc3986.html#section-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:\n\n```text\nrequest.url          == \"http://localhost@google.com\"\nrequest.url.hostname == \"google.com\"\nrequest.url.path     == \"\"\n```\n\nThe 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.\n\nThis requires an ASGI server that forwards a request-target lacking a leading `/` into `scope[\"path\"]`.\n\n### Impact\n\nAny 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.\n\nNote that this is less exploitable than [GHSA-86qp-5c8j-p5mr](https://github.com/Kludex/starlette/security/advisories/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.\n\n### Mitigation\n\nUpgrade 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\"`.","format":"markdown","source":"ghsa"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2026-06-15T20:38:08.000Z","modified":"2026-10-25T23:10:00.167Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N","score":3.7,"rating":"LOW"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N","score":3.7,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N","score":3.7,"rating":"LOW"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":5.3,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":5.3,"rating":"MEDIUM"}],"cwes":["CWE-20","CWE-706"],"affected":[{"ranges":[{"version":"< 1.3.0","status":"affected"}],"vendor":"Kludex","product":"starlette","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.3.0"}],"ecosystem":"PyPI","package":"starlette","purl":"pkg:pypi/starlette","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"1.3.0"}],"vendor":"encode","product":"starlette","cpe":"cpe:2.3:a:encode:starlette:*:*:*:*:*:python:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.3.0"}],"ecosystem":"PyPI","package":"starlette","purl":"pkg:pypi/starlette","source":"pysec"}],"references":[{"url":"https://github.com/Kludex/starlette/security/advisories/GHSA-jp82-jpqv-5vv3","tags":["advisory","mitigation","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-54282","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/Kludex/starlette","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/starlette/PYSEC-2026-248.yaml","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-06-22T17:26:39.551Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-54282","url":"https://www.cve.org/CVERecord?id=CVE-2026-54282","licence":"CVE Terms of Use","modified":"2026-06-22T17:26:58.637Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-jp82-jpqv-5vv3","url":"https://github.com/advisories/GHSA-jp82-jpqv-5vv3","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:50.050Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-54282","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-54282","licence":"Public domain","modified":"2026-10-25T23:10:00.167Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-248","url":"https://osv.dev/vulnerability/PYSEC-2026-248","licence":"CC-BY-4.0","modified":"2026-06-27T11:15:06.799Z"}],"updatedAt":"2026-11-25T22:59:25.397Z","epss":{"score":0.00187,"percentile":0.08696,"date":"2026-12-01T12:00:22.000Z"}}