{"cve":"CVE-2026-27959","nvd":{"published":"2026-02-26T02:16:23.317","modified":"2026-07-15T02:19:12.817","status":"Modified","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.","cvss_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","score":7.5},"cwes":["CWE-20"],"references":["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://access.redhat.com/errata/RHSA-2026:10184","https://access.redhat.com/errata/RHSA-2026:7249"],"products":["koajs:koa"],"source":"nvd","synced_at":"2026-10-19T22:24:17.937441719+00:00"},"epss":{"cve":"CVE-2026-27959","score":0.00391,"percentile":0.33258,"date":"2026-11-01"},"kev":null,"osv":[{"id":"GHSA-7gcc-r8m5-44qm","url":"https://osv.dev/vulnerability/GHSA-7gcc-r8m5-44qm","summary":"Koa has Host Header Injection via ctx.hostname","modified":"2026-02-26T23:41:18.848183Z","packages":[{"ecosystem":"npm","name":"koa","purl":"pkg:npm/koa","ranges":[">=3.0.0 <3.1.2"],"fixed":["3.1.2"]},{"ecosystem":"npm","name":"koa","purl":"pkg:npm/koa","ranges":["<2.16.4"],"fixed":["2.16.4"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}