CVE-2026-54282: Starlette Request URL Hostname Spoofing Vulnerability
Starlette versions prior to 1.3.0 contain a flaw in how they reconstruct the request URL from incoming HTTP requests. When a malicious HTTP request contains a path that doesn't start with a forward slash (such as @google.com), the URL parsing logic gets confused about where the authority (hostname) section ends and treats attacker-supplied content as the hostname. Applications that trust the reconstructed request.url.hostname value instead of validating the actual Host header can be tricked into accepting requests as if they came from a different domain. An attacker could exploit this to bypass hostname-based access controls or mislead applications in authentication decisions.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 3.7 LOW · CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N
- Weaknesses (CWE)
- CWE-706
- Affected products
- 1 configuration(s)
- Published / Modified
- 2026-06-22 / 2026-06-26
NVD description (verbatim)
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.
1 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
The vulnerability stems from how Starlette reconstructs the request URL by concatenating scheme, host, and path components before re-parsing them. RFC 3986 defines the authority boundary with clear syntax; however, when a path parameter lacks the required leading slash, the re-parsing step shifts the authority boundary, causing HTTP request path content to become part of the parsed hostname. This occurs because the naive string concatenation followed by URL re-parsing doesn't validate the path format before assembly. An attacker can craft a request with a malicious path like /[email protected] to cause request.url.hostname to reflect the injected host. The vulnerability affects code paths that call request.url.hostname rather than reading the authoritative Host header from request.headers or accessing scope['server'][0].
Business impact
Organizations using Starlette for HTTP request handling face a risk of host header spoofing if their application logic relies on request.url.hostname for security decisions. This could enable attackers to bypass hostname-based access controls, forge request origins in logging or audit trails, or circumvent Host header validation in API gateway configurations. The impact is limited to applications that actively trust the reconstructed URL hostname without additional verification, but such patterns are not uncommon in authentication filters, CORS validation, or multi-tenant routing logic.
Affected systems
Starlette framework versions prior to 1.3.0 are affected. This includes all 1.2.x, 1.1.x, 1.0.x and earlier releases. The Encode project maintains Starlette as a foundational ASGI toolkit used directly in production applications and as a dependency in other frameworks. Users running Starlette-based applications should verify their installed version immediately.
Exploitability
Exploitation requires network access to the Starlette application and the ability to craft HTTP requests with non-standard path formats. The attack complexity is rated as high because the malicious path must be properly formed to trigger the parsing boundary shift, and the application must explicitly trust request.url.hostname in a security-relevant context. An attacker cannot exploit this remotely against a patched version. The CVSS score of 3.7 reflects the limited scope (only applications reading the reconstructed URL hostname) and the conditional nature of the flaw (requires code to actually misuse the value).
Remediation
Upgrade Starlette to version 1.3.0 or later, which includes path validation before URL reconstruction. For applications that cannot immediately upgrade, the primary mitigation is to audit code for any reliance on request.url.hostname and replace such checks with explicit Host header validation via request.headers.get('host') or direct scope inspection. Consider implementing a Web Application Firewall rule to reject requests with non-standard path encoding or authority injection patterns.
Patch guidance
Update Starlette to 1.3.0 or later. For most projects, this is a standard dependency update: pip install --upgrade starlette>=1.3.0 or update your requirements.txt or pyproject.toml accordingly. Verify against the official Encode Starlette release notes to confirm your version includes the fix. No special configuration changes are required post-patch.
Detection guidance
Monitor HTTP access logs for requests containing unusual path formats, particularly those with @ characters or authority-like syntax in the path component (e.g., /[email protected]). Check application logs for hostname validation mismatches between the Host header and any logged request.url.hostname values. Review code repositories for patterns where request.url.hostname, request.url.netloc, or request.url.authority are used in authentication, authorization, or routing decisions without independent Host header verification. Intrusion detection systems can flag requests where the path portion contains authority-like characters.
Why prioritize this
Although the CVSS score is low (3.7), this vulnerability deserves immediate attention because it directly undermines hostname validation, a fundamental security boundary in web applications. The flaw is subtle—developers may not realize their use of request.url.hostname is unsafe—and the exploit is trivial once the vulnerability is understood. Prioritize patching in applications exposed to untrusted clients or used in multi-tenant environments where host-based isolation is a control.
Risk score, explained
The CVSS 3.1 score of 3.7 is rated LOW with a network attack vector (AV:N), high attack complexity (AC:H), no privileges required (PR:N), no user interaction (UI:N), unchanged scope (S:U), no confidentiality impact (C:N), low integrity impact (I:L), and no availability impact (A:N). The high complexity reflects the requirement for both a correctly-formed malicious path and vulnerable application code that trusts the reconstructed URL. The integrity impact is limited to potential spoofing of the request origin; no data is leaked or system availability compromised. In practice, risk depends heavily on your application's specific use of request.url.hostname.
Frequently asked questions
Do I need to update if my application only reads the Host header and never calls request.url.hostname?
No, your application is not directly vulnerable if it consistently validates the Host header from request.headers or scope['server']. However, you should still upgrade to 1.3.0 to eliminate the underlying flaw and reduce the chance of future misuse by yourself or collaborators.
Can this vulnerability be exploited to steal user credentials or session data?
Not directly. The vulnerability allows an attacker to spoof the hostname in the reconstructed request URL, which could mislead authentication or authorization logic. However, it does not provide direct access to credentials or cookies—the impact depends on how your application uses the spoofed hostname value.
Is Starlette in the CISA Known Exploited Vulnerabilities (KEV) catalog?
No, this vulnerability is not currently listed in the CISA KEV catalog, indicating it has not been observed in active exploitation in the wild. This does not eliminate the need to patch; it simply means threat actors have not widely weaponized this flaw yet.
If I use FastAPI, am I affected?
FastAPI is built on Starlette, so if your FastAPI installation depends on a vulnerable Starlette version, you are at risk. Upgrade FastAPI to a version that requires Starlette 1.3.0 or later, or directly upgrade Starlette in your environment.
This analysis is provided for informational purposes and reflects the vulnerability details as of the published date. Organizations should verify compatibility with their specific Starlette version and application dependencies before applying patches. This document does not constitute security advice for any particular system; consult your security team and the official Encode Starlette advisory for definitive guidance. No exploit code or proof-of-concept is provided; responsible disclosure practices should be observed. Source: NVD (public-domain), retrieved 2026-07-28. Analysis generated by SEC.co (claude-haiku-4-5).
Related vulnerabilities
- CVE-2026-10696HIGHUniGetUI WinGet Backend Package Name Mismatch RCE
- CVE-2026-45306MEDIUMpyLoad Session File Disclosure and Account Takeover
- CVE-2026-48817MEDIUMStarlette HTTPEndpoint Method Reflection Bypass
- CVE-2026-48818HIGHStarlette Windows SSRF Credential Leakage in Static File Serving
- CVE-2026-54283HIGHStarlette Form Parsing Bypass Allows Denial of Service
- CVE-2022-48575LOWmacOS Login Window Bypass via State Handling Flaw
- CVE-2024-42206LOWHCL iReflection Third-Party Component Vulnerability
- CVE-2024-58350LOWGhidra Use-After-Free in Sleigh Backend