PoC Monitor
← All CVEs
CVE-2026-27959published 26 Feb 2026 01:45 UTCData: JSON · API

Koa

Koa has Host Header Injection via `ctx.hostname`

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.

First public PoC 12 daysafter publication · 9 Mar 2026
Public PoCs11 on GitHub
CVSS7.5high · scored by CNA · CWE-20
CISA KEV Not listednot known exploited

Affected versions and mitigation

From the CVE record and the vendor's references.

Affected

koajs koa
  • >= 3.0.0, < 3.1.2
  • < 2.16.4

Fixed in 3.1.2, 2.16.4

Timeline

Days relative to CVE publication
-2t=0+2+4+6+8+10+12CVE published26 Feb 2026 · t = 0First public PoC9 Mar 2026 · t+12d

First public PoC 12 days after publication; not in CISA KEV. First PoC: mlouazir/CVE-2026-27959-mini-lab (created 9 Mar 2026, found by us: backfilled).

PoC repositories

Found on GitHub.

1 PoCs

PoCs 1
RepositoryCreatedStarsAssessment
mlouazir/CVE-2026-27959-mini-lab 9 Mar 2026 +12 d 0 PoC
Flags · score 15
  • no network code found (normal for a local exploit)

Below the suspicion threshold (50); does not change the assessment.

Only PoCs count toward the first-PoC date and the characteristics below. Do not run PoC code from unknown sources.

PoC characteristics

What to hunt for in your logs · from 1 PoC repo

GET /

Key headers
Host: localhost@evil.com
Ports
3000
Seen in
1 repo: mlouazir/CVE-2026-27959-mini-lab
Evidence
mlouazir/CVE-2026-27959-mini-lab/app.js:6

Regex

Generated from PoC characteristics; not yet reviewed. Matches the request path and query.

GET /
(?i)^/(?:[?#].*)?$

Suricata

Template generated from PoC characteristics. Review before deploying.

GET /
alert http any any -> $HOME_NET [3000] (msg:"GG PoC-Monitor CVE-2026-27959 koajs koa exploit attempt"; flow:established,to_server; http.method; content:"GET"; http.header; content:"Host: localhost@evil.com"; nocase; reference:url,poc.griffinguard.io/cve/CVE-2026-27959; classtype:web-application-attack; sid:9859032; rev:1;)

Sigma

Template generated from PoC characteristics. Review before deploying.

GET /
title: koajs koa exploit attempt (CVE-2026-27959)
id: gg-pocmon-cve-2026-27959-9859032
status: experimental
description: Request pattern taken from public PoCs for CVE-2026-27959. Generated, not reviewed.
references:
  - https://poc.griffinguard.io/cve/CVE-2026-27959
logsource:
  category: webserver
detection:
  selection:
    cs-method: GET
  condition: selection
falsepositives:
  - Authorized vulnerability scanning
level: high
tags:
  - attack.initial_access
  - attack.t1190
  - cve.2026.27959