NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · vLLM

CVE-2026-48746: vLLM: OpenAI auth bypass

criticalCVSS 3.1 9.1GHSA-94f4-hr76-p5j6

vLLM versions from 0.3.0 before 0.22.0 can be reached without the configured API key. A crafted Host header changes the path the auth middleware sees, so requests to /v1 endpoints skip the VLLM_API_KEY or --api-key check. Servers exposed directly to attackers are affected; upgrade to vLLM 0.22.0.

Published Jun 16, 2026 · Updated Sep 1, 2026 · Analysis Oct 26, 2026

What an attacker can do

vLLM's AuthenticationMiddleware in vllm/entrypoints/openai/api_server.py decides whether to check the token with URL(scope=scope).path.removeprefix(root_path) and url_path.startswith("/v1"). Starlette rebuilds that URL from the scheme, the Host header and the path. Neither Starlette nor the ASGI servers, including uvicorn, filter the Host header for characters such as / or ?. An attacker can put them in Host and make the reconstructed path something other than /v1.

Routing uses the real HTTP path, not the parsed URL. So the request still reaches the /v1 endpoint, while the middleware thinks the path is outside /v1 and skips the token check. X41's starlette write-up shows the same disagreement: Host: foo gets a 403 on a protected path, while Host: foo? gets 200.

The attacker needs only network access to the vLLM port. They can then use the OpenAI-compatible API with no key: run inference at your cost, read what the API exposes, and exhaust GPU capacity (CVSS 9.1: confidentiality and availability high). The advisory says instances behind an RFC-conforming web server such as nginx are not affected.

Who is affected

vllm from 0.3.0 up to but not including 0.22.0 on PyPI. You are exposed when the OpenAI API server is started with VLLM_API_KEY or --api-key and its port is reachable by untrusted clients without a proxy that rejects invalid Host headers. The root cause is also in Starlette before 1.0.1. Check:

pip show vllm starlette

vllm

Ecosystem
PyPI
Affected
>= 0.3.0, < 0.22.0
Fixed in
0.22.0
Check
pip show vllm

How to fix it

Upgrade to vllm 0.22.0 or later:

pip install --upgrade "vllm>=0.22.0"

Pull request 43426 reads the path from scope["path"] instead of building a URL object from the Host header. A review comment on that PR warns scope["path"] is not normalized, so check the release notes for follow-up fixes. X41 also recommends Starlette 1.0.1 or later, and a reverse proxy such as nginx or Apache that rejects invalid Host headers. Put one in front of vLLM now if you cannot upgrade.

How to tell if you were hit

Look in access logs and proxy logs for requests to /v1 routes whose Host header contains /, ? or # characters, or that is not your hostname. Successful 200 responses on /v1/models, /v1/chat/completions or /v1/completions from sources that never presented a key point to a bypass. Unexplained GPU usage or request counts from unfamiliar addresses are another sign.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

A vulnerability in ASGI web servers and starlette's trust on those web servers enables an authentication bypass of the OpenAI API AuthenticationMiddleware, which was discovered during @x41sec's source code audit. It allows to use the API without providing the configured VLLM_API_KEY or --api-key.

Details

In https://github.com/vllm-project/vllm/blob/v0.14.0/vllm/entrypoints/openai/api_server.py#L689-L692 the url_path is taken from the URL, which is reconstructed by _starlette_ based on the request scope.

from starlette.datastructures import URL, Headers, MutableHeaders, State

# ...

url_path = URL(scope=scope).path.removeprefix(root_path)
headers = Headers(scope=scope)
if url_path.startswith("/v1") and not self.verify_token(headers):
    response = JSONResponse(content={"error": "Unauthorized"}, status_code=401)
    return response(scope, receive, send)
return self.app(scope, receive, send)

The request scope includes the request's Host: header and reconstructs the URL as shown below:

f"{scheme}://{host_header}{path}"

Neither starlette nor any of the ASGI servers (including uvicorn, which vllm uses) properly filter the Host: header for invalid characters. This allows an attacker to include special URL characters such as / or ? in the Host: header and thereby control the reconstructed URL and it's .path attribute.

FastAPI/starlette's routing uses the HTTP path and does not depend on the parsed url.path attribute, allowing attackers to reach an endpoint via a certain path while providing a different value in the .path.

Impact

  • Instances of vllm that use an API Key for the OpenAI API and expose the API to attackers.
  • Instances behind an RFC-conforming web server (such as nginx) are not affected.

Credited to x41j, russellb, DarkLight1337.

Questions

Does CVE-2026-48746 affect vLLM behind nginx?

The advisory says instances behind an RFC-conforming web server such as nginx are not affected, because the server rejects the malformed Host header.

Which vLLM version fixes it?

0.22.0. Versions from 0.3.0 up to 0.22.0 are vulnerable.

Does it matter if I use no API key?

If you set no key, the API is already open. The bypass only matters to deployments that rely on VLLM_API_KEY or --api-key to protect the OpenAI endpoints.

Is it exploited in the wild?

The sources do not report exploitation, and the entry has no CISA KEV data.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More vLLM vulnerabilities

All vLLM entries