CVE-2026-27959
Userinfo Host Header Injection via ctx.hostname
01Record
| Identifier | CVE-2026-27959 |
|---|---|
| Project | Koa |
| Component | ctx.hostname |
| CWE | CWE-74 |
| CVSS | 7.5 |
| Disclosed | 2026-02-26 |
| Endor reference | ENDOR-VUL-2026-2301 |
| Writeup | Link |
02Detail
Description: Koa's ctx.hostname getter parses the HTTP Host header by splitting on the first colon, without validating that the value conforms to RFC 3986 authority syntax. RFC 3986 permits an optional userinfo component before an @ delimiter, so a crafted header such as evil.com:fake@legitimate.com:3000 causes ctx.hostname to return the attacker-controlled evil.com rather than the real host. Affects versions before 2.16.4 and, on the 3.x line, before 3.1.2.
Impact: Host Header Injection. Applications that build security-sensitive URLs from ctx.hostname (password reset links, email verification URLs) or that make routing decisions on it can be redirected to an attacker-chosen host, enabling password reset poisoning.
Discovered by Peyton Kennedy (p80n).