Live threats

All CVEs / Koajs

CVE-2026-27959Koajs Koa

High 7.5 No auth needed

Priority
60
CVSS 3.1
7.5
EPSS
—
Auth required
No
Published
Feb 26, 2026
Updated
Jul 15, 2026
Category
Application · Cross-platform
Weakness (CWE)
CWE-20
SSVC (CISA)
Exploitation: proof of concept · Automatable: yes · Technical impact: partial
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

What happens

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.

Original NVD text.

What to do

  1. Apply the vendor's security update for Koa.
  2. It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.

Affected packages

EcosystemPackageAffected versionsFixed inHow to upgrade
npm koa ≥ 3.0.0 < 3.1.2 3.1.2 npm install koa@3.1.2
npm koa < 2.16.4 2.16.4 npm install koa@2.16.4

Per OSV / GitHub Advisories (GHSA-7gcc-r8m5-44qm). Check the version in your lockfile before upgrading.

Affected products (CPE)

VendorProductVersions
koajskoa< 2.16.4
koajskoa≥ 3.0.0 < 3.1.2

Official sources

References

Links published by the sources. Open them with care.