CVE-2026-25478
Regex Injection in Litestar CORSConfig Allows Origin Spoofing
Publication date: 2026-02-09
Last updated on: 2026-02-17
Assigner: GitHub, Inc.
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| litestar | litestar | to 2.20.0 (exc) |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-942 | The product uses a web-client protection mechanism such as a Content Security Policy (CSP) or cross-domain policy file, but the policy includes untrusted domains with which the web client is allowed to communicate. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
This vulnerability exists in the Litestar ASGI framework versions prior to 2.20.0. It involves the CORSConfig.allowed_origins_regex, which is a regular expression constructed from configured allowlist values to validate origins. Because metacharacters in the allowlist values are not escaped, a malicious origin can unexpectedly match the regex validation. This means that the check using allowed_origins_regex.fullmatch(origin) can be bypassed by crafted origins.
How can this vulnerability impact me? :
The vulnerability can allow a malicious origin to bypass the intended CORS origin validation. This could lead to unauthorized cross-origin requests being accepted by the server, potentially exposing sensitive data or functionality to untrusted origins.
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, upgrade Litestar to version 2.20.0 or later, where the issue with allowed_origins_regex is fixed by properly escaping metacharacters in the regex used for origin validation.