CVE-2026-48710: Starlette builds request.url from an unchecked Host header, letting a crafted Host bypass path-based security checks

ByLinuxtastic

November 30, 2026 #CVE, #Starlette

Starlette is the Python ASGI toolkit underneath FastAPI, and therefore underneath a large share of the API servers, model-serving gateways and MCP servers running on Linux today. Before version 1.0.1 it rebuilt request.url from the client’s Host header without checking the header first, so a request with a crafted Host could make request.url.path read as one path while the router had actually served another. Any middleware that decided “is this request allowed?” by looking at request.url.path could be walked past. CISA added it to the Known Exploited Vulnerabilities catalogue on 2 September 2026. If a service of yours imports Starlette or FastAPI, upgrade Starlette to 1.0.1 or later in every virtual environment and container image that holds it, and restart the ASGI server. The bug does nothing on its own; it needs application code that trusts request.url for an access decision, which is exactly the kind of code people write.

CVE-2026-48710 at a glance.

ComponentStarlette, the ASGI framework and toolkit (PyPI starlette, Debian and Ubuntu python3-starlette, Alpine py3-starlette); every FastAPI application, and anything else built on Starlette, carries it
Affected versionsStarlette from 0.8.3 up to and including 1.0.0 (NVD, X41 and Alpine give the 0.8.3 start; the GitHub advisory simply says 1.0.0 and earlier)
Fixed inStarlette 1.0.1, released 21 May 2026 (commit 764dab0); distribution packages below
SeverityCVSS 3.1 6.5 Medium (AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N) from the GitHub CNA, NVD and Red Hat alike. The finders, X41, rate it High on CVSS 4.0 (7.0, with the impact landing on the application behind Starlette rather than on Starlette itself), and OSTIF’s disclosure says the 6.5 understates the downstream effect. Red Hat Moderate. CWE-444 inconsistent interpretation of HTTP requests (CNA); Red Hat files it as CWE-1289, X41 as CWE-436
Exploited in the wildYes. Added to CISA’s Known Exploited Vulnerabilities catalogue on 2 September 2026; federal remediation due 16 September 2026; CISA’s SSVC note says exploitation is active and automatable, and that the flaw has been chained with CVE-2026-42271. EPSS 0.70 (99th percentile) on 16 November 2026
Who is exposedAny Starlette or FastAPI service whose middleware or endpoints make security decisions from request.url.path instead of the raw scope["path"], and which a client can reach either directly or through a proxy that forwards a malformed Host untouched. Model-serving and AI-gateway deployments (vLLM, LiteLLM and similar) are the population CISA and the finders name
PublishedGitHub advisory 21 May 2026, CVE record 26 May 2026; this page built 30 November 2026, last updated 30 November 2026

What it is

An ASGI server such as Uvicorn hands Starlette a scope dictionary with the request path in scope["path"] and the headers as raw bytes. Starlette’s router matches on scope["path"], which is correct. But the convenience object request.url is built separately: Starlette takes the scheme, appends the value of the Host header, appends the path and query, and parses the resulting string back into a URL. Before 1.0.1 it did not check that the Host value was actually a host. A Host containing a character that the URL grammar treats as the end of the authority, such as a slash, a question mark or a hash, moves the boundary when the string is reparsed, so the host part swallows some of what should be the path and request.url.path comes out different from scope["path"]. The finders’ name for the technique, “BadHost”, is what the CVE record, the X41 advisory and the PyPA advisory all cross-reference.

The consequence is a classic inconsistent-interpretation bug. A middleware written as “if the path starts with /admin, require a token” that reads the path from request.url sees a path that does not start with /admin, lets the request through, and the router, which never looked at Host, dispatches it to the admin handler anyway. Starlette’s own routing, its Mount prefixes and its TrustedHostMiddleware were not the problem; the problem is every bit of application code, in Starlette or in a framework on top of it, that treats request.url.path as the truth. Red Hat’s statement is blunt about the precondition: the flaw does not grant access on its own, and is exploitable only where an application uses request.url.path for access control. That is also why the CVSS 3.1 score is a 6.5 while the people who found it rate it High: the base score measures Starlette, and the damage happens one layer up.

The fix in 1.0.1 validates the Host header against the grammar of RFC 9112 §3.2 and RFC 3986 §3.2.2 when it constructs request.url, and for a value that fails that check it falls back to the address the server itself reported in scope["server"]. X41 D-Sec found the bug on 27 January 2026 during an audit of vLLM that OSTIF ran with sponsorship from the Alpha-Omega Project, reported it on 4 February, and the maintainer’s patch went public on 21 May with the advisory following on the 22nd. The fix commit is public on GitHub; this run could not read it, so the file list is not given here, and the description above is the maintainer’s and X41’s.

Who is affected on Linux

Each row is what the distribution’s own security tracker said on 30 November 2026; the link in the row is the tracker page, which will be newer than this one. Most Starlette installs are not distribution packages at all but pip installs inside a virtual environment or a container image, and those are covered by the last row.

DistributionStatusFixed package
Alpine 3.24, edgeFixedpy3-starlette 1.1.0-r0
Alpine 3.23Possibly vulnerablepy3-starlette 0.47.2-r0 shipped; no fixed build listed
Debian trixieFixedpython3-starlette 0.46.1-3+deb13u2 (DSA-6302-1); tracker now shows 0.46.1-3+deb13u3
Debian bookwormFixedpython3-starlette 0.26.1-1+deb12u1 (DSA-6302-1); security archive now at 0.26.1-1+deb12u2
Debian bullseyeIgnored (minor issue)no fix planned for the LTS package
Debian forky, sidFixed1.1.0-1 and later; sid now carries 1.9.0-1
Ubuntu 22.04, 24.04, 26.04, 26.10Needs evaluation (priority High)no fixed python3-starlette listed on any release; 25.10 marked end of life unfixed. Use the pip route below
RHEL, Rocky, AlmaNot shipped as an RPMRed Hat rates it Moderate; the affected Red Hat products are container images (OpenShift AI 3.3 and 3.4, Ansible Automation Platform 2.6 and 2.7, Satellite 6.17 to 6.19, Migration Toolkit for Applications 8.2, RHEL AI 3, AI Inference Server) fixed by RHSAs between June and August 2026
Fedora, openSUSE, ArchNot consultedtrackers not read for this page
Any pip install, virtualenv, Docker image, uv or Poetry lockAffected below 1.0.1starlette>=1.0.1 from PyPI, and a FastAPI release whose pin allows it

How to check

Three questions, in order: is a vulnerable Starlette present anywhere on the host, does any of your code make decisions from request.url, and can a client reach the ASGI server with an arbitrary Host. The first is the one that takes longest, because Starlette hides in virtual environments and images rather than in the package database.

# 1. every Starlette on the box: system Python, venvs, images already unpacked on disk
find / -xdev -type d -name 'starlette-*.dist-info' 2>/dev/null | sed -E 's#.*/starlette-([^/]+)\.dist-info#\1  &#'
python3 -c 'import importlib.metadata as m; print(m.version("starlette"))' 2>/dev/null
pip show starlette fastapi 2>/dev/null | grep -E '^(Name|Version|Location)'
dpkg -l python3-starlette 2>/dev/null | grep '^ii'        # Debian / Ubuntu
apk info -v py3-starlette 2>/dev/null                      # Alpine
# anything that prints 0.8.3 .. 1.0.0 is affected

# 2. the vulnerable pattern: your own code reading request.url for a decision
grep -rnE 'request\.url(\.path)?' --include='*.py' /srv /opt /app /home 2>/dev/null | grep -v site-packages | head -40

# 3. is the ASGI server itself on a reachable port
ss -ltnp | grep -E 'uvicorn|gunicorn|hypercorn|granian|python'

Step 1 ending with nothing below 1.0.1 means you are done, provided you also rebuilt any image that bakes its own copy. A hit in step 2 is not automatically a hole: logging a URL is harmless, and comparing it is only dangerous when the comparison gates access. Read each match and ask whether a wrong answer would let a request through. Step 3 matters for the mitigation below: an ASGI server bound to 0.0.0.0 is reachable without whatever proxy you thought was in front of it.

Because this one is on the exploited list, also look back. The tell is a Host header that is not a host. Uvicorn’s default access log does not record Host, so the place to look is the reverse proxy, and only if its log format includes $http_host (nginx) or %{Host}i (Apache); a Starlette app can also be told to log request.headers["host"] going forward.

# nginx, if log_format records $http_host: a Host value containing / ? or # is the signature
zgrep -hE 'Host: ?\S*[/?#]' /var/log/nginx/access.log* 2>/dev/null | head
# generic: any header line captured in your logs whose Host value contains a path delimiter
journalctl -u your-api --since '2026-01-01' --no-pager 2>/dev/null | grep -iE 'host[=:] ?[^ ,]*[/?#]' | head

A hit means someone was probing or using the bypass against that service, and the question becomes what the protected paths did. Treat anything an admin or internal endpoint could do (model loading, configuration, key material) as possibly done, and rotate what those endpoints could reach.

How to fix it

Upgrade Starlette in every environment that holds it and restart the server process; an imported module does not change until the interpreter does. FastAPI pins the Starlette range it accepts, so an old FastAPI may refuse 1.0.1 until FastAPI itself is upgraded; do both and let the resolver tell you.

# pip / virtualenv (run inside each venv that has it)
pip install -U 'starlette>=1.0.1' fastapi
pip show starlette | grep ^Version          # must be 1.0.1 or later
# uv / Poetry: bump the lock, then re-sync
uv lock --upgrade-package starlette && uv sync
poetry update starlette fastapi

# Debian / Ubuntu packaged copy
apt update && apt install --only-upgrade python3-starlette
# Alpine
apk upgrade py3-starlette

# containers: rebuild, do not patch in place
docker build --pull --no-cache -t your-api:patched . && docker compose up -d

# then restart whatever runs the app
systemctl restart your-api        # or: docker compose restart

If you cannot upgrade today, Red Hat’s two mitigations are the right ones. First, change the application: anything that gates access on request.url.path should compare request.scope["path"] instead, which is the value the router uses and which Host cannot influence. Second, put an RFC-compliant reverse proxy in front of the ASGI server so that a malformed Host is rejected or normalised before Starlette sees it, and make sure the ASGI port is not reachable except from the proxy.

# the code-side mitigation, in middleware: compare the raw scope path, not request.url
path = request.scope["path"]          # instead of request.url.path

# the network-side mitigation: keep the ASGI server off the public interface
uvicorn app:app --host 127.0.0.1 --port 8000     # proxy terminates on the public address
ss -ltnp | grep 8000                              # must show 127.0.0.1, not 0.0.0.0 or *

The mistake to avoid is counting the proxy as the fix while the ASGI server is still bound to every interface, which is how most container deployments come out of the box: the proxy normalises Host for the traffic that goes through it, and the attacker simply connects to port 8000. Equally, adding TrustedHostMiddleware is good hygiene but is not a complete answer here, because the bypass is in how request.url is built, not in which hosts are allowed; upgrade, and fix the comparisons.

Sources

  • CVE-2026-48710 at CVE.org — the record, affected range and references (GitHub CNA, published 26 May 2026; Red Hat and CISA ADP containers)
  • NVD entry — Analyzed; CVSS 3.1 6.5 from NVD, GitHub and Red Hat; CPE range 0.8.3 to before 1.0.1; KEV cross-reference
  • CISA Known Exploited Vulnerabilities — added 2 September 2026, action due 16 September 2026, chained with CVE-2026-42271
  • GHSA-86qp-5c8j-p5mr — the maintainer’s advisory, 21 May 2026, patched in 1.0.1; fix commit 764dab0
  • X41-2026-002 — the finders’ advisory with the technical explanation, timeline and CVSS 4.0 reading; OSTIF’s disclosure of the audit that found it
  • PYSEC-2026-161 — the PyPA advisory with the full affected-version list
  • Distribution trackers: Debian · Ubuntu · Red Hat · Alpine
  • EPSS score for this CVE, 16 November 2026

Related reading

This advisory page was assembled from the primary sources listed above on 30 November 2026 and is updated when they change. The facts are theirs; the checks and the ordering are ours. If a row in the distribution table is out of date, the tracker link in that row is the current word.