CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-25479

The Dot That Killed the Host: Litestar AllowedHosts Bypass

Alon Barad
Alon Barad
Software Engineer

Feb 9, 2026·5 min read·36 visits

Executive Summary (TL;DR)

Litestar < 2.20.0 treats dots in 'allowed_hosts' as regex wildcards. 'example.com' matches 'exampleXcom'. This allows Host Header Injection.

A classic regular expression logic flaw in Litestar's AllowedHostsMiddleware allows attackers to bypass host header validation. By failing to escape the dot character in configured hostnames, the middleware interprets them as regex wildcards, enabling Host Header Injection attacks.

The Hook: Trust Issues

In the chaotic world of web security, the Host header is often the only thing tethering an application to reality. It tells the backend, 'Hey, I'm serving traffic for this domain.' When frameworks blindly trust this header, we get Host Header Injection—a vulnerability that serves as the gateway drug to cache poisoning, password reset hijacking, and illicit redirects.

To combat this, responsible frameworks like Litestar implement an AllowedHostsMiddleware. It’s essentially a bouncer at the club door, checking the ID of every incoming request against a VIP list. If your name isn't on the list, you don't get in. Simple, right?

Well, it turns out the bouncer had a bit of a reading comprehension problem. In Litestar versions prior to 2.20.0, the logic used to verify these hosts contained a subtle but devastating flaw in how it handled regular expressions. It’s a textbook example of why 'string' and 'regex pattern' are not synonyms, and why assuming they are is a great way to get your application pwned.

The Flaw: When a Dot is Not a Dot

The vulnerability stems from a fundamental misunderstanding of how Python's re module consumes strings. When a developer configures allowed_hosts=["api.example.com"], they intend for that string to be a literal match. They want the middleware to say, 'If the host is exactly api.example.com, allow it.'

However, Litestar took these configuration strings and fed them directly into a regular expression compiler without escaping them first. In the regex world, the dot character (.) is a diva. It doesn't just sit there being a period; it acts as a wildcard that matches any single character (except a newline).

So, to the Litestar middleware, the configuration api.example.com wasn't a strict domain name. It was interpreted as the regex pattern api.example.com. This means it would happily match api.example.com, but it would also match api-example.com, apiXexample.com, or api/example.com. The bouncer wasn't checking for your specific ID; he was checking if your name had roughly the right number of letters.

The Code: The Smoking Gun

Let's look at the code that caused the headache. The issue resided in litestar/middleware/allowed_hosts.py. The middleware took the list of allowed hosts and compiled them directly. Here is a reconstruction of the logic flaw:

# THE VULNERABLE LOGIC
import re
 
allowed_hosts = ["api.example.com"]
# The framework compiled the string directly as a regex pattern
regex_pattern = re.compile(f"^({'|'.join(allowed_hosts)})$", flags=re.IGNORECASE)
 
# This matches the legitimate host...
print(bool(regex_pattern.match("api.example.com")))  # True
 
# ...but also matches this malicious one:
print(bool(regex_pattern.match("api-example.com")))  # True (OOPS)

The fix was painfully simple but critical. The developers needed to ensure that the configuration strings were treated as literals, not patterns. Python's standard library provides re.escape() for exactly this purpose.

# THE FIX (v2.20.0)
import re
 
allowed_hosts = ["api.example.com"]
 
# Escape the strings first! 
# "api.example.com" becomes "api\.example\.com"
escaped_hosts = [re.escape(h) for h in allowed_hosts]
 
regex_pattern = re.compile(f"^({'|'.join(escaped_hosts)})$", flags=re.IGNORECASE)
 
# Now the malicious host is rejected
print(bool(regex_pattern.match("api-example.com")))  # False

The Exploit: Poisoning the Well

How do we weaponize a stray dot? The goal here is Host Header Injection. Since the middleware validates the Host header before the application processes it, bypassing this check allows us to trick the application into thinking it resides at a domain controlled by the attacker.

Scenario: You are targeting a password reset flow on sso.corp.com. The application generates reset links using the incoming Host header because the developers were too lazy to hardcode the canonical URL.

  1. Reconnaissance: You determine the target is running an older version of Litestar.
  2. Registration: You register the domain sso-corp.com (note the hyphen).
  3. The Attack: You send a password reset request for a victim user, but you manipulate the Host header:
POST /reset-password HTTP/1.1
Host: sso-corp.com
Content-Type: application/json
 
{"email": "admin@corp.com"}
  1. The Bypass: The regex sso.corp.com matches sso-corp.com. The middleware says "Pass."
  2. The Impact: The application generates a reset email containing: https://sso-corp.com/reset-token?user=admin

When the admin clicks that link, they aren't going to the corporate SSO. They are landing on your server, where you harvest the token and take over the account.

The Mitigation: Escape Your Inputs

For developers using Litestar, the path forward is straightforward: Upgrade to version 2.20.0 immediately. This version includes the patch that applies re.escape() to all host entries.

If you are stuck on an older version and cannot upgrade (why?), you have a manual workaround: escape the dots in your configuration yourself.

Instead of: allowed_hosts=["api.example.com"]

Use: allowed_hosts=["api\\.example\\.com"]

However, relies on you remembering to double-escape backslashes in your config files, which is error-prone. The real lesson here is about defensive coding. Never assume a string is just a string when passing it to a regex engine. If you aren't writing a regex pattern, escape it. Always.

Official Patches

LitestarFix commit implementing re.escape()

Fix Analysis (1)

Technical Appendix

CVSS Score
6.5/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N

Affected Systems

Litestar Framework (Python)

Affected Versions Detail

Product
Affected Versions
Fixed Version
Litestar
Litestar Organization
< 2.20.02.20.0
AttributeDetail
CWE IDCWE-185 (Incorrect Regular Expression)
CVSS Score6.5 (Medium)
Attack VectorNetwork
ConfidentialityLow
IntegrityLow
Exploit StatusPoC Available

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1557Adversary-in-the-Middle
Credential Access
CWE-185
Incorrect Regular Expression

Known Exploits & Detection

GitHub Security AdvisoryOfficial advisory describing the regex bypass mechanism.

Vulnerability Timeline

Internal identification of the issue.
2025-12-14
CVE-2026-25479 Published.
2026-02-09
Litestar v2.20.0 Released with fix.
2026-02-09

References & Sources

  • [1]GitHub Advisory GHSA-93ph-p7v4-hwh4
  • [2]Litestar v2.20.0 Release Notes

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•43 minutes ago•CVE-2026-59831
4.4

CVE-2026-59831: Remote Code Execution via Unvalidated URL Scheme Handling in GitHub CLI

GitHub CLI (gh) versions 2.10.0 through 2.95.0 contain an input validation vulnerability in the `gh codespace jupyter` command path. When connecting to a remote Codespace to launch a JupyterLab session, the CLI retrieves a server URL via a remote procedure call (RPC) and passes it directly to the host operating system's default URL dispatcher without validating the scheme or target host. A compromised or malicious Codespace can return a custom protocol URI, such as `vscode://` or `vscode-insiders://`, allowing an attacker to invoke local desktop application handlers and achieve arbitrary command execution on the developer's workstation.

Alon Barad
Alon Barad
2 views•9 min read
•about 2 hours ago•CVE-2026-59191
6.9

CVE-2026-59191: Path Traversal and Arbitrary File Read in CakePHP TwigView FileLoader

A path traversal vulnerability exists in the cakephp/twig-view plugin for the CakePHP framework prior to versions 1.3.3 and 2.1.2. The Cake\TwigView\Twig\FileLoader::findTemplate() method verifies template existence using PHP's native file_exists() function without ensuring the target path resides within configured application or plugin template directories. When user-controlled input is passed to template inclusion mechanisms, an unauthenticated remote attacker can read arbitrary local files accessible to the PHP runtime.

Alon Barad
Alon Barad
4 views•9 min read
•about 3 hours ago•CVE-2026-64855
8.2

CVE-2026-64855: Cryptographic Signature Verification Bypass in soapbar WS-Security Implementation

CVE-2026-64855 (GHSA-859w-52fx-hcm6) is a cryptographic signature verification and authentication bypass vulnerability in the soapbar Python library prior to version 0.13.0. In vulnerable versions, the verify_envelope_bsp() function derives its trust anchor directly from the incoming SOAP message by extracting an untrusted X.509 certificate embedded inside the wsse:BinarySecurityToken header. Because the function checks only the temporal validity of the extracted certificate without performing Certificate Authority (CA) chain validation or certificate pinning, an unauthenticated network attacker can generate a self-signed certificate, sign an arbitrary SOAP payload, and pass verification.

Amit Schendel
Amit Schendel
4 views•10 min read
•about 4 hours ago•GHSA-JP3C-6V3G-MPXV
6.5

GHSA-jp3c-6v3g-mpxv: Uncaught Runtime Panic via Integer Underflow in insomniacslk/dhcp BroadcastRawUDPConn

A denial-of-service vulnerability exists in the Go library github.com/insomniacslk/dhcp within the dhcpv4/nclient4 subpackage. In affected versions, the raw packet parsing function BroadcastRawUDPConn.ReadFrom subtracts the fixed 8-byte UDP header length from the IPv4 payload length declared in the packet header without first verifying that the declared payload length is at least 8 bytes. An unauthenticated attacker on an adjacent local network segment can broadcast or unicast a malformed IPv4 packet with a declared payload length between 0 and 7 bytes, causing a signed integer underflow that passes a negative slice bound into buf.Consume and triggers an unhandled Go runtime panic.

Amit Schendel
Amit Schendel
5 views•12 min read
•about 5 hours ago•CVE-2026-63305
8.1

CVE-2026-63305: OS Command Injection in WWBN AVideo Standalone FFmpeg Script

CVE-2026-63305 (GHSA-g9x9-q7qj-6mv5) is an operating system command injection vulnerability affecting WWBN AVideo (formerly YouPHPTube) versions up to and including 29.0. The defect resides in the standalone FFmpeg execution handler at plugin/API/standAlone/ffmpeg.json.php. When assembling asynchronous post-processing commands, the script concatenates the notifyCode and callback properties from a decrypted payload directly into a shell command string without sanitization. An attacker capable of providing or forging a valid encrypted execution payload can inject shell metacharacters to achieve remote code execution under the privileges of the web server user.

Alon Barad
Alon Barad
5 views•10 min read
•about 8 hours ago•CVE-2026-59192
6.9

CVE-2026-59192: Unsafe Deserialization in CakePHP TwigView UtilsExtension

The cakephp/twig-view plugin integrates the Twig templating engine into the CakePHP framework. Prior to versions 1.3.3 and 2.1.2, the UtilsExtension class exposes PHP's native unserialize() function as a Twig filter without restricting allowed classes. When untrusted data is passed into the unserialize filter within a template, an attacker can trigger PHP Object Injection and execute Property-Oriented Programming (POP) gadget chains, leading to arbitrary code execution or data manipulation.

Alon Barad
Alon Barad
5 views•8 min read