CVE Catalog

CVE-2026-27959

HighCVSS 7.5
Published: Updated: Translated: NVD NIST

Exploitation Probability (EPSS)

Low risk
0.33%

25th percentile - higher than 25% of all known CVEs

Summary

A vulnerability in the Koa library for Node.js involves improper parsing of the Host header by the `ctx.hostname` API. An attacker can send a crafted Host header containing a `@` symbol, causing the API to return an attacker-controlled value, e.g., `evil[.]com`. The issue affects versions prior to 3.1.2 and 2.16.4.

Risk Assessment

The risk is a Host header injection attack, which can lead to generation of malicious password reset links, email verification URLs, or incorrect routing decisions. The organization is exposed to user account takeover and data leakage.

Recommendation

Immediately update the Koa library to version 3.1.2 or 2.16.4 depending on the major version in use. After updating, verify application functionality, especially in places using `ctx.hostname`.

Related vulnerabilities

Original NVD description (English source)

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.

Vulnerability data from NVD (NIST) · CISA KEV · EPSS