CVE-2026-27959
published high CVSS 3.1 · 7.5Koa has Host Header Injection via `ctx.hostname`
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| koajs | — | koa>= 3.0.0, < 3.1.2 · < 2.16.4 | Affected | Not stated | GitHub_M |
| Red Hat | — | rhoai/odh-dashboard-rhel9Red Hat OpenShift AI 2.25 · 1776742021 and later · Other versions: affected | Unaffected | Not stated | redhat-SADP |
| Red Hat | — | rhoai/odh-mod-arch-model-registry-rhel9Red Hat OpenShift AI 2.25 · 1776742141 and later · Other versions: affected | Unaffected | Not stated | redhat-SADP |
| Red Hat | — | openshift4/ose-monitoring-plugin-rhel9Red Hat OpenShift Container Platform 4.19 · 1775577192 and later · Other versions: affected | Unaffected | Not stated | redhat-SADP |
| Red Hat | — | rhdh/rhdh-hub-rhel9Red Hat Developer Hub | Affected | Not stated | redhat-SADP |
| Red Hat | — | rhoai/odh-mod-arch-gen-ai-rhel9Red Hat OpenShift AI (RHOAI) | Unknown | Not stated | redhat-SADP |
| Red Hat | — | devspaces/code-rhel9Red Hat OpenShift Dev Spaces | Unaffected | Not required | redhat-SADP |
| Red Hat | — | ansible-automation-platform/automation-portalSelf-service automation portal 2 | Affected | Not stated | redhat-SADP |
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.
A flaw was found in Koa’s ctx.hostname API used in Node.js applications. The function incorrectly parses specially crafted HTTP Host headers containing an @ character, which can cause the extracted hostname value to differ from the intended origin. An attacker can exploit this behavior by sending a malicious Host header to influence the hostname value returned by ctx.hostname. Applications that rely on this value for generating absolute URLs, password reset links, or email verification links without additional validation may be susceptible to Host header injection attacks.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.5 / 10
- Severity
- high
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Additional Assessments
| Version | Score | Severity | Provider | Vector | Scenarios |
|---|---|---|---|---|---|
| 3.1 | 8.2 | high | redhat-SADP · adp | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N | — |
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| koajs | koa | >= 3.0.0, < 3.1.2 (affected)< 2.16.4 (affected) | GitHub_M · cna |
| Red Hat | Red Hat OpenShift AI 2.25 | 1776742021 and later (unaffected · rpm)Default: affected | redhat-SADP · adp |
| Red Hat | Red Hat OpenShift AI 2.25 | 1776742141 and later (unaffected · rpm)Default: affected | redhat-SADP · adp |
| Red Hat | Red Hat OpenShift Container Platform 4.19 | 1775577192 and later (unaffected · rpm)Default: affected | redhat-SADP · adp |
| Red Hat | Red Hat Developer Hub | Default: affected | redhat-SADP · adp |
| Red Hat | Red Hat OpenShift AI (RHOAI) | Default: unknown | redhat-SADP · adp |
| Red Hat | Red Hat OpenShift Dev Spaces | Default: unaffected | redhat-SADP · adp |
| Red Hat | Self-service automation portal 2 | Default: affected | redhat-SADP · adp |
Weaknesses
2- CWE-20 CWE-20: Improper Input Validation
- CWE-20 Improper Input Validation
References
8- https://access.redhat.com/errata/RHSA-2026:10184
- https://access.redhat.com/errata/RHSA-2026:7249
- https://access.redhat.com/security/cve/CVE-2026-27959
- RHBZ#2442928 https://bugzilla.redhat.com/show_bug.cgi?id=2442928
- https://github.com/koajs/koa/commit/55ab9bab044ead4e82c70a30a4f9dc0fc9c1b6df
- https://github.com/koajs/koa/commit/b76ddc01fdb703e51652b0fd131d16394cadcfeb
- https://github.com/koajs/koa/security/advisories/GHSA-7gcc-r8m5-44qm
- https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-27959.json
Provider assertions
3GitHub_M · cna
Koa has Host Header Injection via `ctx.hostname`
redhat-SADP · adp
koa: Koa: Host header injection vulnerability due to malformed HTTP Host header parsing
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 17c9406a0e8736364af0302c72f16b4e6e5c4e0c332525528d6f9be915e72e71
- Ingested
- 23 Sep 2026, 09:07:57 UTC
- Source record
- Official CVE record