CVE-2026-27959: Koa - Host Header Injection
- Cve: CVE-2026-27959
- Name: Koa - Host Header Injection
- 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.
- Impact: Attackers can inject arbitrary hostnames, potentially leading to phishing, URL spoofing, or bypassing security checks.
- Remediation: Upgrade to versions 3.1.2 or 2.16.4 or later.
- Vulnerability type: host_header_injection
- Vulnerability impact: open_redirect
- Requirement type: none
- Labels source: projectdiscovery
- Severity: high
- Cvss score: 7.5
- Cvss vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
- Epss score: 0.004
- Epss percentile: 0.3474
- Assignee: [email protected]
- Published at: 2026-02-26T02:16:23Z
- Age in days: 271
- Modified at: 2026-07-15T02:19:12Z
- Patch available: yes
- Public exploits total: 2
- References total: 8
- Products total: 1
- Oss: yes
- Projects total: 1
- Advisory url: https://nvd.nist.gov/vuln/detail/CVE-2026-27959
- Nvd status: modified
- Checked, none or zero: known exploited entries, nuclei templates, public exploits capped, rejected by nvd
- Not known: requirements, hackerone
Cwe
| Id | Name |
|---|---|
| CWE-20 | Improper Input Validation |
| NVD-CWE-noinfo | — |
Public exploits
| Url | Source | Added date |
|---|---|---|
| https://github.com/koajs/koa/security/advisories/GHSA-7gcc-r8m5-44qm | nvd | 2026-02-26 |
| https://github.com/mlouazir/CVE-2026-27959-mini-lab | poc-in-github | 2026-03-09 |
References
Same in every row:
- Source: nvd
Products
| Product | Affected | Platform bound | Sources | Url |
|---|---|---|---|---|
| koajs:koa | >= 3.0.0, < 3.1.2; < 2.16.4 | no | nvd | /v1/products/koajs/koa |
Projects
| Repository | Link kinds | Indexed | Url |
|---|---|---|---|
| koajs/koa | commit, fix, package, security_advisory | yes | /v1/repositories/koajs/koa |
Index
- Repositories: 88
- Repositories high signal: 55
- Packages: 1
Exploitation
- Public exploit: yes
- Public exploit count: 2
- Public exploit first date: 2026-02-26
- Remote: yes
- Checked, none or zero: known exploited, known exploited by, exploitation seen, initial access, authentication required
- Not known: known exploited since, vulncheck known exploited since, nuclei template, initial access since, hackerone reports, exposed hosts