CVE-2026-27959

Koa has Host Header Injection via `ctx.hostname`

HIGH
7.5
CVSS Score
Published: February 26, 2026 at 01:45 AM UTC
Updated: July 15, 2026 at 02:19 AM UTC
3 products affected across 2 vendorsKoaSelf-Service Automation PortalDeveloper Hub

Using koa by koajs?

Get instant alerts when new vulnerabilities affect koa - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH7.5
Exploit prediction
EPSS 0.4%
SSVC
PoC

Description

Koa is middleware for Node.js using ES2017 async functions. Prior to versions 3.1.2 and 2.16.4, Koa's `ctx.hostname` API performs naive parsing of the HTTP Host header, extracting everything before the first colon without validating the input conforms to RFC 3986 hostname syntax. When a malformed Host header containing a `@` symbol is received, `ctx.hostname` returns `evil[.]com` - an attacker-controlled value. Applications using `ctx.hostname` for URL generation, password reset links, email verification URLs, or routing decisions are vulnerable to Host header injection attacks. Versions 3.1.2 and 2.16.4 fix the issue.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 2.16.4v < 3.1.23.0.0 ≤ v < 3.1.2
Affected range stops below 2.16.4, so it looks safe — our inference, not a vendor statement
Affected range stops below 3.1.2, so it looks safe — our inference, not a vendor statement
All versions

References (8)

x_refsource_CONFIRMExploitVendor Advisory
Source: cverecord
https://github.com/koajs/koa/security/advisories/GHSA-7gcc-r8m5-44qm
Source: 0b0ca135-0b70-47e7-9f44-1890c2a1c46c
https://access.redhat.com/errata/RHSA-2026:10184
Source: 0b0ca135-0b70-47e7-9f44-1890c2a1c46c
https://access.redhat.com/errata/RHSA-2026:7249
Source: 0b0ca135-0b70-47e7-9f44-1890c2a1c46c
https://access.redhat.com/security/cve/CVE-2026-27959
Source: 0b0ca135-0b70-47e7-9f44-1890c2a1c46c
https://bugzilla.redhat.com/show_bug.cgi?id=2442928

SSVC — Action Prioritization

SSVCPoCAutomatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

7.5HIGHGitHub_M
Attack Vector
NETWORK
Complexity
LOW
Privileges
NONE
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
NONE
Integrity
HIGH
Availability
NONE
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-20NVD-CWE-noinfo

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card