Koa has Host Header Injection via `ctx.hostname`

Summary

CVECVE-2026-27959
StatePUBLISHED
AssignerGitHub_M
Source PriorityCVE Program / NVD first with legacy fallback
Published2026-02-26 02:16:23 UTC
Updated2026-07-15 02:19:12 UTC
DescriptionKoa 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.

Risk And Classification

Primary CVSS: v3.1 8.2 HIGH from ADP

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N

Problem Types: CWE-20 | NVD-CWE-noinfo | CWE-20 CWE-20: Improper Input Validation | CWE-20 Improper Input Validation


VersionSourceTypeScoreSeverityVector
3.1ADPCVSS8.2HIGHCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N
3.1[email protected]Secondary7.5HIGHCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
3.10b0ca135-0b70-47e7-9f44-1890c2a1c46cSecondary8.2HIGHCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N
3.1CNADECLARED7.5HIGHCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

CVSS v3.1 Breakdown

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
High
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N

NVD Known Affected Configurations (CPE 2.3)

TypeVendorProductVersionUpdateEditionLanguage
Application Koajs Koa All All All All

Vendor Declared Affected Products

SourceVendorProductVersionPlatforms
CNA Koajs Koa affected >= 3.0.0, < 3.1.2 Not specified
CNA Koajs Koa affected < 2.16.4 Not specified
ADP Red Hat Red Hat OpenShift AI 2.25 unaffected 1776742021 * rpm Not specified
ADP Red Hat Red Hat OpenShift AI 2.25 unaffected 1776742141 * rpm Not specified
ADP Red Hat Red Hat OpenShift Container Platform 4.19 unaffected 1775577192 * rpm Not specified
ADP Red Hat Red Hat Developer Hub Not specified Not specified
ADP Red Hat Red Hat OpenShift AI RHOAI Not specified Not specified
ADP Red Hat Red Hat OpenShift Dev Spaces Not specified Not specified
ADP Red Hat Self-service Automation Portal 2 Not specified Not specified

References

ReferenceSourceLinkTags
github.com/koajs/koa/security/advisories/GHSA-7gcc-r8m5-44qm [email protected] github.com Exploit, Vendor Advisory
bugzilla.redhat.com/show_bug.cgi 0b0ca135-0b70-47e7-9f44-1890c2a1c46c bugzilla.redhat.com
access.redhat.com/errata/RHSA-2026:10184 0b0ca135-0b70-47e7-9f44-1890c2a1c46c access.redhat.com
access.redhat.com/errata/RHSA-2026:7249 0b0ca135-0b70-47e7-9f44-1890c2a1c46c access.redhat.com
github.com/koajs/koa/commit/55ab9bab044ead4e82c70a30a4f9dc0fc9c1b6df [email protected] github.com Patch
security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-27959.json 0b0ca135-0b70-47e7-9f44-1890c2a1c46c security.access.redhat.com
access.redhat.com/security/cve/CVE-2026-27959 0b0ca135-0b70-47e7-9f44-1890c2a1c46c access.redhat.com
github.com/koajs/koa/commit/b76ddc01fdb703e51652b0fd131d16394cadcfeb [email protected] github.com Patch
CVE Program record CVE.ORG www.cve.org canonical
NVD vulnerability detail NVD nvd.nist.gov canonical, analysis

Additional Advisory Data

SourceTimeEvent
ADP2026-02-26T03:01:14.695ZReported to Red Hat.
ADP2026-02-26T01:45:45.668ZMade public.

Solutions

ADP: RHSA-2026:10184: Red Hat OpenShift AI 2.25

ADP: RHSA-2026:7249: Red Hat OpenShift Container Platform 4.19

Workarounds

ADP: Red Hat is not aware of a practical temporary workaround that fully mitigates this issue or meets Red Hat Product Security's standards for usability, deployment, applicability, or stability. Customers are advised to apply the relevant security updates once they become available.

© CVE.report 2026

Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. It is the responsibility of user to evaluate the accuracy, completeness or usefulness of any information, opinion, advice or other content. EACH USER WILL BE SOLELY RESPONSIBLE FOR ANY consequences of his or her direct or indirect use of this web site. ALL WARRANTIES OF ANY KIND ARE EXPRESSLY DISCLAIMED. This site will NOT BE LIABLE FOR ANY DIRECT, INDIRECT or any other kind of loss.

CVE, CWE, and OVAL are registred trademarks of The MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. This site includes MITRE data granted under the following license.

Free CVE JSON API cve.report/api

CVE.report and Source URL Uptime Status status.cve.report