{"id":"CVE-2026-27959","summary":"Koa has Host Header Injection via `ctx.hostname`","details":"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.","aliases":["GHSA-7gcc-r8m5-44qm"],"modified":"2026-08-12T03:51:18.993429977Z","published":"2026-02-26T01:45:45.668Z","database_specific":{"cwe_ids":["CWE-20"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/27xxx/CVE-2026-27959.json","cna_assigner":"GitHub_M"},"references":[{"type":"WEB","url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-27959.json"},{"type":"ADVISORY","url":"https://access.redhat.com/errata/RHSA-2026:10184"},{"type":"ADVISORY","url":"https://access.redhat.com/errata/RHSA-2026:7249"},{"type":"ADVISORY","url":"https://access.redhat.com/security/cve/CVE-2026-27959"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/27xxx/CVE-2026-27959.json"},{"type":"ADVISORY","url":"https://github.com/koajs/koa/security/advisories/GHSA-7gcc-r8m5-44qm"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-27959"},{"type":"REPORT","url":"https://bugzilla.redhat.com/show_bug.cgi?id=2442928"},{"type":"FIX","url":"https://github.com/koajs/koa/commit/55ab9bab044ead4e82c70a30a4f9dc0fc9c1b6df"},{"type":"FIX","url":"https://github.com/koajs/koa/commit/b76ddc01fdb703e51652b0fd131d16394cadcfeb"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/koajs/koa","events":[{"introduced":"0"},{"fixed":"ca76ea6a4f2f49fb75575730404da146f66cb43c"},{"introduced":"ead934d8f2e36244336d67ad075c6b2faf4e7267"},{"fixed":"c5a52e056d61afa012a08d3aa89a59bce5ccbf1b"},{"fixed":"55ab9bab044ead4e82c70a30a4f9dc0fc9c1b6df"},{"fixed":"b76ddc01fdb703e51652b0fd131d16394cadcfeb"}],"database_specific":{"cpe":"cpe:2.3:a:koajs:koa:*:*:*:*:*:node.js:*:*","extracted_events":[{"introduced":"0"},{"fixed":"2.16.4"},{"introduced":"3.0.0"},{"fixed":"3.1.2"}],"source":["CPE_RANGE","REFERENCES"]}}],"versions":["v2.16.3","v3.1.1","v3.1.0","v3.0.3","v2.16.2","v3.0.2","v3.0.1","v2.16.1","v3.0.0","v2.16.0","2.15.4","2.15.3","2.15.2","2.15.1","2.15.0","2.14.2","2.14.1","2.14.0","2.13.4","2.13.3","2.13.2","2.13.1","2.13.0","2.12.1","2.12.0","2.11.0","2.10.0","2.9.0","2.8.2","2.8.1","2.8.0","2.7.0","2.6.2","2.6.1","2.6.0","2.5.3","0.21.0","2.5.2","2.5.1","2.5.0","2.4.1","2.4.0","2.3.0","2.1.0","2.0.1","2.0.0-alpha.8","2.0.0-alpha.7","2.0.0-alpha.6","2.0.0-alpha.5","2.0.0-alpha.4","2.0.0-alpha.3","2.0.0-alpha.2","2.0.0-alpha.1","1.1.0","1.0.0","0.20.0","0.19.1","0.19.0","0.18.1","0.18.0","0.17.0","0.16.0","0.15.0","0.14.0","0.13.0","0.12.2","0.12.1","0.12.0","0.11.0","0.10.0","0.9.0","0.8.2","0.8.1","0.8.0","0.7.0","0.6.3","0.6.2","0.6.1","0.6.0","0.5.5","0.5.4","0.5.3","0.5.2","0.5.1","0.5.0","0.4.0","0.3.0","0.2.1","0.2.0","0.1.2","0.1.1","0.1.0","0.0.2"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-27959.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"}]}