GHSA-86qp-5c8j-p5mr CVE-2026-48710 PYSEC-2026-161 X41-2026-002
Starlette has missing Host header validation that poisons request.url.path, bypassing path-based security checks
- Severity
- 6.5 / 10
- Medium · CVSS 3.1
- Exploit chance (EPSS)
- 70.29%
- Chance of exploitation in the next 30 days. Higher than 99.38% of scored vulnerabilities.
- Known exploited
- Yes
- In CISA's catalog since Sep 2, 2026
- Weakness
- CWE-444 Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling')
- CWE-1289 Improper Validation of Unsafe Equivalence in Input
- Fix
1.0.1- Upgrade starlette to this version or later
Description
Summary
In affected versions, the HTTP Host request header was not validated before being used to reconstruct request.url. Because the routing algorithm relies on the raw HTTP path while request.url is rebuilt from the Host header, a malformed header could make request.url.path differ from the path that was actually requested. Middleware and endpoints that apply security restrictions based on request.url (rather than the raw scope path) could therefore be bypassed.
Details
When a client requests http://example.com/foo, it sends:
GET /foo HTTP/1.1
Host: example.com
Affected versions reconstructed the URL by concatenating http://{host}{path} and re-parsing the result. The Host value is only valid as a uri-host [ ":" port ] per RFC 9112 §3.2, where uri-host follows the restricted host grammar of RFC 3986 §3.2.2. When it contains characters outside that grammar - notably /, ?, or # - those characters move the path/query/fragment boundaries during re-parsing, so the parsed request.url.path no longer matches the path the server actually received. For example:
GET /foo HTTP/1.1
Host: example.com/abc?bar=
reconstructs to http://example.com/abc?bar=/foo, whose parsed path is /abc - even though routing used the real path /foo. The router still dispatches to /foo and the endpoint executes, but any middleware or code that reads request.url.path sees /abc, so path-based authorization checks can be bypassed.
Impact
Any application running an affected version that relies on request.url (or request.url.path) for security-sensitive decisions is affected. The most common case is middleware that gates access to certain path prefixes based on request.url.path. Deployments fronted by a proxy or load balancer are mitigated only if that proxy rejects or normalizes the malformed Host header before forwarding and the application does not trust attacker-controlled host headers (e.g. X-Forwarded-Host) elsewhere.
Mitigation
Upgrade to a patched version, which validates the Host header against the grammar of RFC 9112 §3.2 / RFC 3986 §3.2.2 when constructing request.url and falls back to scope["server"] for malformed values.
Affected versions
PyPI
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
starlette PyPI → 1.0.1
- pip
pip install --upgrade "starlette>=1.0.1"- poetry
poetry add "starlette>=1.0.1"- uv
uv add "starlette>=1.0.1"
Severity breakdown
CVSS 3.1 6.5
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- Low
- Integrity
- Low
- Availability
- None
Weakness
CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling')
The product acts as an intermediary HTTP agent (such as a proxy or firewall) in the data flow between two entities such as a client and server, but it does not interpret malformed HTTP requests or responses in ways that are consistent with how the messages will be processed by those entities that are at the ultimate destination.
How to prevent it
- Implementation: Use a web server that employs a strict HTTP parsing procedure, such as Apache [REF-433].
- Implementation: Use only SSL communication.
- Implementation: Terminate the client session after each request.
- System Configuration: Turn all pages to non-cacheable.
CWE-1289: Improper Validation of Unsafe Equivalence in Input
The product receives an input value that is used as a resource identifier or other type of reference, but it does not validate or incorrectly validates that the input is equivalent to a potentially-unsafe value.
How to prevent it
- Implementation: Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
References
Advisories
- github.com/advisories/GHSA-86qp-5c8j-p5mr
- github.com/Kludex/starlette/security/advisories/GHSA-86qp-5c8j-p5mr
- nvd.nist.gov/vuln/detail/CVE-2026-48710
- x41-dsec.de/lab/advisories/x41-2026-002-starlette
- x41-dsec.de/lab/advisories/x41-2026-002-starlette
- access.redhat.com/errata/RHSA-2026:63337
- cisa.gov/known-exploited-vulnerabilities-catalog
- wiz.io/blog/ai-infrastructure-honeypot
Fixes and patches
Write-ups
Packages
Other links
- badhost.org
- github.com/pypa/advisory-database/tree/main/vulns/starlette/PYSEC-2026-161.yaml
- ostif.org/disclosing-the-badhost-vulnerability-in-starlette
- secwest.net/starlette
- cve.org/CVERecord
- security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-48710.json
- bugzilla.redhat.com/show_bug.cgi
- access.redhat.com/security/cve/CVE-2026-48710
- access.redhat.com/errata/RHSA-2026:34532
- access.redhat.com/errata/RHSA-2026:34526
- access.redhat.com/errata/RHSA-2026:34456
- access.redhat.com/errata/RHSA-2026:30089
- access.redhat.com/errata/RHSA-2026:30088
- access.redhat.com/errata/RHSA-2026:26226
- access.redhat.com/errata/RHSA-2026:24866
- access.redhat.com/errata/RHSA-2026:23346
- access.redhat.com/errata/RHSA-2026:22993
- access.redhat.com/errata/RHSA-2026:22992
- access.redhat.com/errata/RHSA-2026:37275
- access.redhat.com/errata/RHSA-2026:43038
- access.redhat.com/errata/RHSA-2026:44696
- access.redhat.com/errata/RHSA-2026:51357
- access.redhat.com/errata/RHSA-2026:60520
Timeline
- Published
- Added to CISA's Known Exploited Vulnerabilities catalog
- Remediation due for U.S. federal agencies
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-82w8-qh3p-5jfq Starlette: request.form() limits silently ignored for application/x-www-form-urlencoded enable DoS | High | Also affects starlette |
| GHSA-jp82-jpqv-5vv3 Starlette: Unvalidated request path concatenated into authority poisons request.url.hostname | Medium | Also affects starlette |
| GHSA-wqp7-x3pw-xc5r Starlette: SSRF and NTLM credential theft via UNC paths in StaticFiles on Windows | High | Also affects starlette |
| GHSA-x746-7m8f-x49c Starlette: Arbitrary HTTP method dispatched to `HTTPEndpoint` attributes via `getattr` | Medium | Also affects starlette |
| GHSA-7f5h-v6xp-fcq8 Starlette vulnerable to O(n^2) DoS via Range header merging in ``starlette.responses.FileResponse`` | High | Also affects starlette |
| GHSA-2c2j-9gv5-cj73 Starlette has possible denial-of-service vector when parsing large files in multipart forms | Medium | Also affects starlette |
| GHSA-f96h-pmfr-66vw Starlette Denial of service (DoS) via multipart/form-data | High | Also affects starlette |
| GHSA-v5gw-mw7f-84px Starlette has Path Traversal vulnerability in StaticFiles | High | Also affects starlette |
Credits: ehhthing, nic-lovin, x41j
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor