# CVE-2026-27959: Koa has Host Header Injection via `ctx.hostname`

- Severity: High 7.5 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.40%, higher than 36% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-02-26T01:45:45.668Z
- Modified: 2026-07-15T02:19:12.817Z
- Also known as: GHSA-7gcc-r8m5-44qm
- Weaknesses: CWE-20, CWE-74
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- koajs koa: >= 3.0.0, < 3.1.2; < 2.16.4; before 2.16.4; from 3.0.0 before 3.1.2
- rhoai/odh-dashboard-rhel9: no versions given (not affected: from 1776742021 before *)
- rhoai/odh-mod-arch-model-registry-rhel9: no versions given (not affected: from 1776742141 before *)
- openshift4/ose-monitoring-plugin-rhel9: no versions given (not affected: from 1775577192 before *)
- rhdh/rhdh-hub-rhel9: no versions given
- rhoai/odh-mod-arch-gen-ai-rhel9: no versions given
- devspaces/code-rhel9: no versions given
- ansible-automation-platform/automation-portal: no versions given
- koa (npm): from 3.0.0 before 3.1.2; before 2.16.4

## Every score

- GitHub_M: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`
- redhat-SADP: CVSS:3.1 8.2 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N`
- GitHub: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`

## References

- <https://github.com/koajs/koa/security/advisories/GHSA-7gcc-r8m5-44qm> (exploit, vendor-advisory, web)
- <https://github.com/koajs/koa/commit/55ab9bab044ead4e82c70a30a4f9dc0fc9c1b6df> (patch, web)
- <https://github.com/koajs/koa/commit/b76ddc01fdb703e51652b0fd131d16394cadcfeb> (patch, web)
- <https://access.redhat.com/security/cve/CVE-2026-27959> (vdb-entry)
- <https://bugzilla.redhat.com/show_bug.cgi?id=2442928> (issue-tracking)
- <https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-27959.json>
- <https://access.redhat.com/errata/RHSA-2026:10184> (vendor-advisory)
- <https://access.redhat.com/errata/RHSA-2026:7249> (vendor-advisory)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-27959> (advisory)
- <https://github.com/koajs/koa> (package)

## Sources

- CVE List: [CVE-2026-27959](https://www.cve.org/CVERecord?id=CVE-2026-27959), CVE Terms of Use, modified 2026-07-15
- GitHub Advisory Database: [GHSA-7gcc-r8m5-44qm](https://github.com/advisories/GHSA-7gcc-r8m5-44qm), CC-BY-4.0, modified 2026-02-26
- NVD: [CVE-2026-27959](https://nvd.nist.gov/vuln/detail/CVE-2026-27959), Public domain, modified 2026-07-15

---

Page: https://cve.day/CVE-2026-27959 · Whole record: https://cve.day/CVE-2026-27959.json · Rebuilt by cve.day 2026-11-25T22:59:14.942Z
