Skip to main content
VulnerabilityPublished Updated

CVE-2026-27959: koajs koa · Improper Input Validation

Affects koajs koaSource CVE Database V5

0
Compare

Not known to be exploited · CVSS 7.5 High : upgrade to 3.1.2 or 2.16.4 soon.

Data as of 30 Oct 2026, 11:52 UTC

CVSS 3.1 base score
7.5High
How severe the flaw is on the 0–10 CVSS scale.
EPSS
0.3% chance of exploitation in 30 days – higher than 33% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
Patch
Available – fixed in 3.1.2, 2.16.4
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 26 Feb 2026

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponized: evidence found.

    Public exploit code: GitHub proofs of concept

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq Mirage: no evidence on record.

    No attack traffic recorded by OffSeq Mirage sensors

A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), GitHub proofs of concept, the Metasploit, Exploit-DB and nuclei-templates index as of 30 Oct 2026.

What to do

Upgrade koajs koa to 3.1.2 or 2.16.4.

Affected software

ProductAffectedFixed in
koajskoaAffected
  • >=3.0.0 <3.1.2
Fixed in
  • 3.1.2
koajskoaAffected
  • <2.16.4
Fixed in
  • 2.16.4
npmkoapkg:npm/koaOther threatsAffected
  • <2.16.4
  • <3.1.2
Fixed in
  • 2.16.4
  • 3.1.2

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

A fix is available in Koa versions 2.16.4 and 3.1.2. Users should upgrade to at least these versions to remediate the vulnerability. No additional vendor advisory indicates alternative mitigations or that no action is required.

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.

References

Community reviews

Loading reviews…