CVE-2026-142247: Koa through 3.3.0 Host Header Validation Bypass via request.hostname
Koa through 3.3.0 fails to properly validate Host header values containing URL delimiters, allowing remote attackers to bypass hostname allowlists in request.host and request.hostname. Attackers can send a Host header with a backslash, slash, question mark, or hash so ctx.hostname ends with a trusted domain while ctx.href resolves to an attacker host, poisoning redirects and password reset links.
Affected Software
Event History
Frequently Asked Questions
Which deployments are most exposed to this issue?
Koa applications that use request.host or request.hostname for hostname allowlists and then generate redirects or password-reset links are most exposed. The issue can cause the hostname check to see a trusted domain while the resulting URL resolves to an attacker-controlled host.
Does exploitation require an authenticated attacker or victim interaction?
The supplied vector indicates that no attacker privileges are required, but user interaction is required. An attacker can send a crafted Host header and would need a victim to follow or use a poisoned redirect or password-reset link.
What Host header values are relevant when investigating attempted exploitation?
The affected validation can be bypassed using Host header values containing a backslash, slash, question mark, or hash. Review requests and application behavior involving these delimiters where hostname-based allowlists or generated links are used.