Security Resilience

CVE-2026-27959

Koajs Koa ≤ 2.16.4

Public PoC
Published
26 February 2026
Modified
15 July 2026
Patch / advisory
CVSS Score v3.1 7.5
Click a component to see what it means
Raw vectorCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
EPSS Score 0.0053 44th percentile
Risk Priority 58 floored blend · peak EPSS

CVSS and EPSS are reproduced from their sources (NVD, FIRST EPSS). Risk Priority is our own derived reading, not an NVD score.

Summary

CVE-2026-27959 is a high-severity Improper Input Validation (CWE-20) vulnerability in Koajs Koa. Its CVSS base score is 7.5 (High).

Operationally, ranked at the 44th percentile by exploit likelihood (below the median); it is not currently listed in the CISA KEV catalog; a public proof-of-concept is referenced.

The strongest mitigations our analysis identified map to SA-11 (Developer Testing and Evaluation) and SI-10 (Information Input Validation) — see the control section below for these in your framework.

Deeper analysis AI-assisted summary

Synthesised by an AI model from the NVD description and linked references — a reading aid, not an authoritative source.

CVE-2026-27959 is a Host header injection vulnerability in Koa, a middleware framework for Node.js that uses ES2017 async functions. The issue affects Koa versions prior to 3.1.2 and 2.16.4, specifically in the `ctx.hostname` API, which naively parses the HTTP Host header by extracting everything before the first colon without validating conformance to RFC 3986 hostname syntax. A malformed Host header containing an `@` symbol causes `ctx.hostname` to return an attacker-controlled value, such as `evil[.]com`. The vulnerability is rated 7.5 on the CVSS v3.1 scale (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N) and is associated with CWE-20 (Improper Input Validation).

Remote attackers without authentication can exploit this vulnerability by sending a specially crafted HTTP request with a malformed Host header. Exploitation succeeds if the affected application relies on `ctx.hostname` for generating URLs, password reset links, email verification URLs, or routing decisions, enabling Host header injection attacks. This allows attackers to manipulate outbound links or redirects to point to malicious domains, potentially leading to phishing, open redirects, or unauthorized actions, with high integrity impact but no confidentiality or availability disruption.

The Koa security advisory (GHSA-7gcc-r8m5-44qm) and related GitHub commits detail the fix, recommending an upgrade to Koa versions 3.1.2 or 2.16.4, which implement proper validation of the Host header per RFC 3986 syntax. No additional mitigations are specified in the provided references.

OWASP Top 10 for Web (2025)

EU & UK References

Vulnerability Data

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…

more

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.

CWE(s)

Related Threats

CVEs Like This One

CVE-2025-8129Same product: Koajs Koa
CVE-2025-32379Same product: Koajs Koa
CVE-2025-62595Same product: Koajs Koa
CVE-2025-25200Same product: Koajs Koa
CVE-2023-49803Same vendor: Koajs
CVE-2026-21271Shared CWE-20
CVE-2026-21310Shared CWE-20
CVE-2019-11708Shared CWE-20
CVE-2026-42389Shared CWE-20
CVE-2026-13927Shared CWE-20

Affected Assets

koajs
koa
≤ 2.16.4 · 3.0.0 — 3.1.2

Mitigating Controls

Mitigating Controls (NIST 800-53 r5) AI

Developer testing and evaluation can discover missing input validation through analysis or test cases.

SI-10 directly requires validity checks on information inputs, structurally preventing improper or missing validation.

Requiring documented development standards and tools can embed input-validation practices into the engineering process.

Mitigating Controls (ISO/IEC 27001:2022 Annex A) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→ISO cross-walk (authority under review) — links open the control.

finds

Testing against a defined set of requirements and using code review plus vulnerability scanning forces validation of inputs and handling of unanticipated conditions, reducing the chance that malformed data will be accepted.

prevents

Requiring language-specific secure coding standards, peer review, SAST and documented mitigation of common programming errors forces validation of all inputs before they are trusted.

Hardening callouts derived

DISA STIG baselines are authored against specific weaknesses. Where this CVE cites a broad weakness class, the mapping is not asserted at that abstraction (owner ruling, 2026-09-25: grade only at Base and below), so no rule is shown here rather than a rule shown against the wrong grain.

  • No fine-grained STIG row for CWE-20, a class-level weakness, and none of its children carries one either.

References