CVE-2026-25479
Undergoing Analysis Undergoing Analysis - In Progress
Regex Injection in Litestar Allowed Hosts Enables Host Bypass

Publication date: 2026-02-09

Last updated on: 2026-02-17

Assigner: GitHub, Inc.

Description
Litestar is an Asynchronous Server Gateway Interface (ASGI) framework. Prior to 2.20.0, 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. This vulnerability is fixed in 2.20.0.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-02-09
Last Modified
2026-02-17
Generated
2026-05-07
AI Q&A
2026-02-09
EPSS Evaluated
2026-05-05
NVD
EUVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
litestar litestar to 2.20.0 (exc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-185 The product specifies a regular expression in a way that causes data to be improperly matched or compared.
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

This vulnerability exists in the Litestar ASGI framework prior to version 2.20.0. The issue is in the allowed_hosts middleware, where allowlist entries are compiled into regular expressions without escaping regex metacharacters. This means special characters like '.' retain their regex meaning, allowing an attacker to supply a host that matches the regex pattern but is not the intended literal hostname, effectively bypassing host restrictions.


How can this vulnerability impact me? :

An attacker can exploit this vulnerability to bypass host restrictions by supplying a crafted host header that matches the regex pattern but is not an authorized hostname. This can lead to unauthorized access or manipulation of the application, potentially compromising confidentiality and integrity of data.


How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:

I don't know


How can this vulnerability be detected on my network or system? Can you suggest some commands?

I don't know


What immediate steps should I take to mitigate this vulnerability?

To mitigate this vulnerability, you should upgrade Litestar to version 2.20.0 or later, where the issue with allowlist entries being compiled into regex patterns with special meaning is fixed.


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart