{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2026-27959","id":"CVE-2026-27959","title":"Koa has Host Header Injection via `ctx.hostname`","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-con","descriptionLong":"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.","published":"2026-02-26T01:45:45.668Z","updated":"2026-10-28T02:30:48.890865249Z","reserved":"2026-02-25T03:24:57.792Z","status":"Modified","rejected":false,"assigner":"GitHub_M","metric":{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","rating":"high","source":"GitHub_M"},"metrics":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","rating":"high","source":"GitHub_M"},{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","rating":"high","source":"github.com"},{"version":"3.1","score":8.2,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N","rating":"high","source":"0b0ca135-0b70-47e7-9f44-1890c2a1c46c"},{"version":"3.1","score":8.2,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N","rating":"high","source":"redhat-SADP"},{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","rating":"high","source":"OSV"},{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","rating":"high","source":"GitHub"}],"rating":"high","products":["koajs koa"],"affectedProducts":[{"vendor":"koajs","product":"koa","defaultStatus":null,"versions":[{"version":">= 3.0.0, < 3.1.2","status":"affected"},{"version":"< 2.16.4","status":"affected"}],"platforms":[]}],"packages":[{"ecosystem":"npm","name":"koa","purl":"pkg:npm/koa","ranges":[">=3.0.0 <3.1.2","<2.16.4"],"fixed":["3.1.2","2.16.4"],"advisory":"GHSA-7gcc-r8m5-44qm"}],"cwes":["CWE-20","CWE-74"],"aliases":["GHSA-7gcc-r8m5-44qm"],"references":[{"url":"https://github.com/koajs/koa/security/advisories/GHSA-7gcc-r8m5-44qm","tags":["x_refsource_CONFIRM","Exploit","Vendor Advisory","advisory","web"]},{"url":"https://github.com/koajs/koa/commit/55ab9bab044ead4e82c70a30a4f9dc0fc9c1b6df","tags":["x_refsource_MISC","Patch","fix","web"]},{"url":"https://github.com/koajs/koa/commit/b76ddc01fdb703e51652b0fd131d16394cadcfeb","tags":["x_refsource_MISC","Patch","fix","web"]},{"url":"https://access.redhat.com/security/cve/CVE-2026-27959","tags":["vdb-entry","x_refsource_REDHAT","advisory"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2442928","tags":["issue-tracking","x_refsource_REDHAT","report"]},{"url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-27959.json","tags":["x_sadp-csaf-vex","web"]},{"url":"https://access.redhat.com/errata/RHSA-2026:10184","tags":["vendor-advisory","x_refsource_REDHAT","advisory"]},{"url":"https://access.redhat.com/errata/RHSA-2026:7249","tags":["vendor-advisory","x_refsource_REDHAT","advisory"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/27xxx/CVE-2026-27959.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-27959","tags":["advisory"]},{"url":"https://github.com/koajs/koa","tags":["package"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":true,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"partial"},"epss":0.00391,"epssPercentile":0.33975,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2026-27959","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-27959","ok":true,"note":"Modified"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2026-27959","ok":true,"note":"1 package"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-7gcc-r8m5-44qm","ok":true,"note":"GHSA-7gcc-r8m5-44qm"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2026-27959","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}