Skip to main content
Mallory
MediumPublic exploit

BadHost

IdentifiersCVE-2026-48710CWE-20

CVE-2026-48710 ("BadHost") is a Host header validation flaw in Starlette affecting versions prior to 1.0.1. When reconstructing request.url, Starlette used unvalidated user-controlled HTTP Host header data together with the request path and passed the resulting string to Python URL parsing logic. Because the ASGI router continues to use the raw scope["path"] while request.url is rebuilt from the Host header, a malformed Host value containing URL delimiters such as '/', '?', or '#' can cause request.url.path to differ from the actual routed path. This parser differential creates a dual-interpretation condition in which middleware or endpoint logic that makes security decisions based on request.url or request.url.path can be misled into treating a protected request as if it targeted an allowlisted or unauthenticated path, while the underlying protected route still executes.

Share:
For your environment

Are you exposed to this one?

Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.

ANALYST BRIEF

Impact, mitigation & remediation

What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation can bypass path-based authentication, authorization, filtering, and other security controls implemented in middleware or endpoint logic that rely on request.url or request.url.path instead of the raw ASGI path. Depending on the application, this can expose protected endpoints, sensitive data, internal administrative functions, credentials, API keys, and other restricted resources. Reported downstream risks include unauthorized access to AI/LLM control surfaces and, in some deployments, secondary impacts such as SSRF or code-execution exposure if the bypassed endpoint itself provides those capabilities. Availability impact is not the primary concern.

Mitigation

If you can’t patch tonight, do this now.

Do not base security-sensitive path decisions on request.url or request.url.path in affected applications. Use request.scope["path"] or the framework-equivalent raw routed path for authentication and authorization checks. Place a compliant reverse proxy or load balancer in front of ASGI applications and ensure it rejects or normalizes malformed Host headers before they reach the application. Audit custom middleware, dependencies, decorators, rate-limiters, billing gates, CSRF logic, and allowlist/denylist checks for any reliance on request.url-derived paths.

Remediation

Patch, then assume compromise.

Upgrade Starlette to version 1.0.1 or later. The fix validates the Host header against RFC 9112 section 3.2 and RFC 3986 section 3.2.2 when constructing request.url and falls back to scope["server"] for malformed Host values. Where Starlette is bundled transitively, rebuild and redeploy containers, virtual environments, and packaged artifacts to ensure the patched dependency is actually in use. Debian advisories indicate fixed package versions including 0.26.1-1+deb12u1 for bookworm and 0.46.1-3+deb13u2 for trixie.
PUBLIC EXPLOITS

Exploits

1 valid exploit after Mallory filtered fakes, detection scripts, and README-only repos (2 hidden).

VALID 1 / 3 TOTALView more in app
starlette-host-header-labMaturityPoCVerified exploit

This repository is a self-contained training lab and proof-of-concept for a Starlette Host-header URL confusion vulnerability identified as X41-2026-002 / GHSA-86qp-5c8j-p5mr. It is not a weaponized exploit kit; it is a minimal reproducible lab showing how an attacker can bypass path-based authorization when application logic trusts request.url.path, while Starlette routing still uses the raw ASGI scope['path']. Repository structure: app/vulnerable_app.py contains the intentionally vulnerable Starlette application; fixed/fixed_app.py contains a mitigated version for side-by-side comparison; exploit/exploit.sh is the main PoC script; docker-compose.yml and Dockerfile build and expose both services; requirements.txt pins Starlette 0.37.2 and uvicorn 0.29.0; README.md explains the bug, exploitation flow, and mitigations. Main exploit capability: the exploit sends a normal GET request to /admin but injects URL metacharacters into the Host header, especially 'foo?' or 'foo#'. In the vulnerable app, AuthMiddleware.dispatch reads request.url.path into reconstructed_path and allows requests when that path is '/' or ''. Because request.url is reconstructed from the untrusted Host header, a request like GET /admin with Host: foo? yields a reconstructed URL similar to 'http://foo?/admin', making request.url.path parse as empty. The middleware therefore allows the request, but routing still dispatches to the /admin handler using request.scope['path']='/admin'. This results in an authorization bypass and disclosure of the demo secret FLAG{host_header_url_confusion}. Exploit behavior: exploit/exploit.sh defaults to localhost:8000, first verifies that /admin normally returns 403, then retries with crafted Host headers. It demonstrates successful bypass payloads ('Host: foo?' and 'Host: foo#') and a non-working example ('Host: foo/x'). The vulnerable admin handler returns JSON exposing the secret plus diagnostic fields: scope_path, reconstructed_url, reconstructed_path, and host_header, making the discrepancy explicit. Fixed behavior: fixed/fixed_app.py mitigates the issue in two ways: it bases authorization on request.scope['path'] instead of request.url.path, and it adds TrustedHostMiddleware with allowed hosts localhost, 127.0.0.1, and localhost:8001. As a result, malformed Host headers are rejected before application logic, and even without that middleware the auth decision would no longer be confused by URL reconstruction. Overall assessment: this is a legitimate web exploit PoC/lab for an auth bypass caused by Host-header-driven interpretation conflict. It is concise, reproducible, and intended for local training. The exploit is proof-of-concept maturity rather than operational malware: it demonstrates the vulnerability and leaks a demo flag, but does not provide persistence, code execution, or post-exploitation features.

xtremebeingDisclosed May 27, 2026pythonbashweb
EXPOSURE SURFACE

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
DebianStarletteapplication
EncodeStarletteapplication

Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.

ACTIVITY FEED

Recent activity

90 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.

cvereportsNews
Jun 4, 2026
CVE-2026-48710: CVE-2026-48710: Starlette BadHost HTTP Host-Header Path-Poisoning and Authentication Bypass | CVEReports

A vulnerability in Starlette's URL reconstruction logic where an unvalidated Host header is concatenated into a URL string before parsing, allowing parser desynchronization between security middleware and the ASGI router and potentially bypassing access controls to protected endpoints.

Read more
nuclei templates pull requestsNews
Jun 2, 2026
Create CVE-2026-48710.yaml (LiteLLM Auth Bypass via Starlette BadHost) by ritikchaddha · Pull Request #16324 · projectdiscovery/nuclei-templates · GitHub

The content only references the creation of a file named for CVE-2026-48710 in a GitHub conversation. No technical details about the vulnerability are provided.

Read more
scworldNews
May 27, 2026
High-severity Starlette vulnerability ‘BadHost’ could expose sensitive data | brief | SC Media

A high-severity vulnerability in the Starlette Python web framework caused by improper handling of malformed Host headers, which can let attackers bypass security checks by causing incorrect URL construction and potentially expose sensitive data.

Read more
cyber security newsNews
May 27, 2026
Attackers Can Exploit BadHost to Access Sensitive AI Agent Server Endpoints

An authentication bypass vulnerability in Starlette caused by unsafe handling of the HTTP Host header, allowing manipulated headers to alter request path interpretation and bypass middleware-based access controls.

Read more
What this page doesn’t show

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, which detections to deploy, and what to do tonight.
Exposure mapping

Query your assets running an affected version, and investigate the blast radius.

Threat actor evidence

Every observed campaign linking this CVE to a named adversary.

Associated malware

Malware families riding this exploit, with evidence and IOCs.

Detection signatures

YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.

Vendor-by-vendor mapping

Cross-references every affected SKU, including bundled OEM variants.

Social activity80

Community discussion across Reddit, Mastodon, and other social sources.