CVE-2026-27959
February 26, 2026
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 Packages
https://github.com/koajs/koa.git (GITHUB):
Affected version(s) >=v3.0.0 <v3.1.2Fix Suggestion:
Update to version v3.1.2https://github.com/koajs/koa.git (GITHUB):
Affected version(s) >=v2.16.0 <v2.16.4Fix Suggestion:
Update to version v2.16.4koa (NPM):
Affected version(s) >=0.0.1 <2.16.4Fix Suggestion:
Update to version 2.16.4koa (NPM):
Affected version(s) >=3.0.0 <3.1.2Fix Suggestion:
Update to version 3.1.2Related ResourcesĀ (5)
Do you need more information?
Contact UsCVSS v4
Base Score:
8.7
Attack Vector
NETWORK
Attack Complexity
LOW
Attack Requirements
NONE
Privileges Required
NONE
User Interaction
NONE
Vulnerable System Confidentiality
NONE
Vulnerable System Integrity
HIGH
Vulnerable System Availability
NONE
Subsequent System Confidentiality
NONE
Subsequent System Integrity
NONE
Subsequent System Availability
NONE
CVSS v3
Base Score:
7.5
Attack Vector
NETWORK
Attack Complexity
LOW
Privileges Required
NONE
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
NONE
Integrity
HIGH
Availability
NONE
Weakness Type (CWE)
EPSS
Base Score:
0.12