Skip to content
Fencer Vulns
high 8.2

CVE-2026-27959 json

Koa has Host Header Injection via `ctx.hostname`

published 2026-02-26 8 mo ago modified 2026-07-15 3 mo ago also GHSA-7gcc-r8m5-44qm , EUVD-2026-8816

cvss
8.2
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
0.4%
EPSS 0.4% chance of exploitation in 30 days, percentile 33%
public exploits
0
none known

Summary

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.

Patch / fix

  • npm koa 2.16.4, 3.1.2
  • Red Hat Red Hat OpenShift AI 2.25 1776742021, 1776742141
  • Red Hat Red Hat OpenShift Container Platform 4.19 1775577192

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2026-27959 updated cvss 8.2

koa: Koa: Host header injection vulnerability due to malformed HTTP Host header parsing

  • Red Hat Developer Hub 1 rhdh/rhdh-hub-rhel9
    affected: workaround, no fix planned “Will not fix”
  • Red Hat OpenShift AI (RHOAI) rhoai/odh-mod-arch-gen-ai-rhel9
    affected: workaround, no fix planned “Out of support scope”
  • Red Hat Self-service automation portal 2 ansible-automation-platform/automation-portal
    affected: workaround, no fix available
  • Red Hat OpenShift AI 2.25 rhoai 1776742021, rhoai 1776742141
    fixed: vendor fix RHSA-2026:10184
  • Red Hat OpenShift Container Platform 4.19 openshift4 1775577192
    fixed: vendor fix RHSA-2026:7249
  • Red Hat OpenShift AI 2.25 rhoai 1775144403, rhoai 1776243157, rhoai 1776243163, rhoai 1776243192, rhoai 1776243217, rhoai 1776243229, +69 more Red Hat OpenShift Container Platform 4.19 openshift4 1775557242, openshift4 1775557245, openshift4 1775557255, openshift4 1775557257, openshift4 1775557260, openshift4 1775557261, +174 more
    not affected: vulnerable code not present
  • Red Hat OpenShift Dev Spaces devspaces/code-rhel9
    not affected: component not present

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

CISA SSVC

Exploitation
Proof of concept is public
Automatable
yes
Technical impact
partial
Assessed
8 mo ago

Exploit prediction

0.39% chance of exploitation in the next 30 days, higher than 33% of all scored CVEs (FIRST EPSS, 2026-11-08).

Exploits and checks

  • github.com https://github.com/koajs/koa/security/advisories/GHSA-7gcc-r8m5-44qm referenced PoC, tagged "exploit" by a source, unverified

CVSS scores

assigned by version score vector
CNA 3.1 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
CISA ADP 3.1 8.2 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N
CNA 3.1 8.2 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N
GitHub 3.1 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Affected packages

ecosystem package affected fixed in
npm koa
>=3.0.0, <3.1.2
<2.16.4
3.1.2
2.16.4

Affected products

  • koajs koa
  • Red Hat Red Hat OpenShift AI 2.25
  • Red Hat Red Hat OpenShift Container Platform 4.19
  • Red Hat Red Hat Developer Hub
  • Red Hat Red Hat OpenShift AI (RHOAI)
  • Red Hat Red Hat OpenShift Dev Spaces
  • Red Hat Self-service automation portal 2

Classification

Weakness
  • CWE-20 Improper Input Validation
  • CWE-74 Improper Neutralization of Special Elements in Output Used by a Downstream Component

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.