{"id":"CVE-2026-27959","aliases":["CLSA-2026-1788264598","GHSA-7gcc-r8m5-44qm"],"summary":"Koa has Host Header Injection via `ctx.hostname`","published_at":"2026-02-26T01:45:45.668Z","modified_at":"2026-10-15T09:47:55.436659Z","products":[],"rating":{"severity":"high","score":8.2,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N","attack_path":"internet_unauthenticated","user_interaction":false,"malicious":false,"red_hat":"Important","vendor_ratings":[{"source":"Red Hat","rating":"Important"}]},"fix_available":false,"kev":{"listed":false,"ransomware":false},"public_exploit":false,"exploits":[],"epss":{"score":0.003909999970346689,"percentile":0.3397499918937683,"date":"2026-11-19T00:00:00Z"},"priority":10.2,"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.","affected_stack":[],"affected_other":[{"ecosystem":"CVE","package":"koajs/koa","versions":[">= 3.0.0, < 3.1.2","< 2.16.4"],"provider":"cvelistv5","source":"CVE-2026-27959","relation":"self"},{"ecosystem":"NVD","package":"koajs:koa","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.16.4"}]},{"type":"ECOSYSTEM","events":[{"introduced":"3.0.0"},{"fixed":"3.1.2"}]}],"fixed":["2.16.4","3.1.2"],"provider":"nvd","source":"CVE-2026-27959","relation":"self"},{"ecosystem":"TuxCare:npm","package":"koa","purl":"pkg:npm/koa","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.15.3-tuxcare.0"},{"fixed":"2.15.3-tuxcare.1"}]}],"versions":["2.15.3"],"fixed":["2.15.3-tuxcare.1"],"provider":"osv","source":"CLSA-2026-1787657292","relation":"upstream"},{"ecosystem":"TuxCare:npm","package":"koa","purl":"pkg:npm/koa","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"1.7.1-tuxcare.0"},{"fixed":"1.7.1-tuxcare.3"}]}],"versions":["1.7.1","1.7.1-tuxcare.1","1.7.1-tuxcare.2"],"fixed":["1.7.1-tuxcare.3"],"provider":"osv","source":"CLSA-2026-1788264598","relation":"self"},{"ecosystem":"TuxCare:npm","package":"koa","purl":"pkg:npm/koa","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.15.4-tuxcare.0"},{"fixed":"2.15.4-tuxcare.1"}]}],"versions":["2.15.4"],"fixed":["2.15.4-tuxcare.1"],"provider":"osv","source":"CLSA-2026-1792779347","relation":"upstream"},{"ecosystem":"npm","package":"koa","purl":"pkg:npm/koa","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"2.16.4"}]}],"fixed":["2.16.4"],"provider":"osv","source":"GHSA-7gcc-r8m5-44qm","relation":"self"},{"ecosystem":"npm","package":"koa","purl":"pkg:npm/koa","ranges":[{"type":"SEMVER","events":[{"introduced":"3.0.0"},{"fixed":"3.1.2"}]}],"fixed":["3.1.2"],"provider":"osv","source":"GHSA-7gcc-r8m5-44qm","relation":"self"}],"product_status":[{"vendor":"Red Hat","product":"Red Hat Developer Hub 1","cpe":"cpe:/a:redhat:rhdh:1","status":"affected","packages":["rhdh/rhdh-hub-rhel9"],"package_count":1,"fixed":[],"advisories":[],"note":"Will not fix","provider":"redhat-vex","source":"CVE-2026-27959"},{"vendor":"Red Hat","product":"Red Hat OpenShift AI (RHOAI)","cpe":"cpe:/a:redhat:openshift_ai","status":"affected","packages":["rhoai/odh-mod-arch-gen-ai-rhel9"],"package_count":1,"fixed":[],"advisories":[],"note":"Out of support scope","provider":"redhat-vex","source":"CVE-2026-27959"},{"vendor":"Red Hat","product":"Red Hat OpenShift AI 2.25","cpe":"cpe:/a:redhat:openshift_ai:2.25::el9","status":"fixed","packages":["rhoai"],"package_count":1,"fixed":[],"advisories":["RHSA-2026:10184"],"provider":"redhat-vex","source":"CVE-2026-27959"},{"vendor":"Red Hat","product":"Red Hat OpenShift AI 2.25","cpe":"cpe:/a:redhat:openshift_ai:2.25::el9","status":"not_affected","packages":["rhoai"],"package_count":1,"fixed":[],"advisories":[],"note":"vulnerable_code_not_present","provider":"redhat-vex","source":"CVE-2026-27959"},{"vendor":"Red Hat","product":"Red Hat OpenShift Container Platform 4.19","cpe":"cpe:/a:redhat:openshift:4.19::el9","status":"fixed","packages":["openshift4"],"package_count":1,"fixed":[],"advisories":["RHSA-2026:7249"],"provider":"redhat-vex","source":"CVE-2026-27959"},{"vendor":"Red Hat","product":"Red Hat OpenShift Container Platform 4.19","cpe":"cpe:/a:redhat:openshift:4.19::el9","status":"not_affected","packages":["openshift4"],"package_count":1,"fixed":[],"advisories":[],"note":"vulnerable_code_not_present","provider":"redhat-vex","source":"CVE-2026-27959"},{"vendor":"Red Hat","product":"Red Hat OpenShift Dev Spaces","cpe":"cpe:/a:redhat:openshift_devspaces:3","status":"not_affected","packages":["devspaces/code-rhel9"],"package_count":1,"fixed":[],"advisories":[],"note":"component_not_present","provider":"redhat-vex","source":"CVE-2026-27959"},{"vendor":"Red Hat","product":"Self-service automation portal 2","cpe":"cpe:/a:redhat:ansible_portal:2","status":"affected","packages":["ansible-automation-platform/automation-portal"],"package_count":1,"fixed":[],"advisories":[],"note":"Affected","provider":"redhat-vex","source":"CVE-2026-27959"}],"records":[{"provider":"csaf-bsi","source_id":"WID-SEC-W-2026-1007","relation":"upstream","url":"https://wid.cert-bund.de/portal/wid/securityadvisory?name=WID-SEC-2026-1007","license":"TLP:CLEAR, mirroring permitted","published_at":"2026-04-07T22:00:00Z","modified_at":"2026-10-25T23:00:00Z","summary":"IBM App Connect Enterprise: Mehrere Schwachstellen","details":"Ein Angreifer kann mehrere Schwachstellen in IBM App Connect Enterprise ausnutzen, um Sicherheitsvorkehrungen zu umgehen, um einen Denial of Service Angriff durchzuführen, um Informationen offenzulegen, um Dateien zu manipulieren, um einen Cross-Site Scripting Angriff durchzuführen, um einen SQL-Injection Angriff durchzuführen, und um beliebigen Programmcode auszuführen.\n\nIBM App Connect Enterprise kombiniert die branchenbewährten Technologien des IBM Integration Bus mit Cloud-nativen Technologien.","severity":[{"type":"BSI","score":"hoch","source":"WID-SEC-W-2026-1007"}],"affected":[],"product_status":[],"references":[{"type":"WEB","url":"https://wid.cert-bund.de/.well-known/csaf/white/2026/wid-sec-w-2026-1007.json"},{"type":"WEB","url":"https://wid.cert-bund.de/portal/wid/securityadvisory?name=WID-SEC-2026-1007"},{"type":"WEB","url":"https://www.ibm.com/support/pages/node/7268737"},{"type":"WEB","url":"https://www.ibm.com/support/pages/node/7268738"},{"type":"WEB","url":"https://www.ibm.com/support/pages/node/7268740"},{"type":"WEB","url":"https://www.ibm.com/support/pages/node/7268741"},{"type":"WEB","url":"https://www.ibm.com/support/pages/node/7268743"},{"type":"WEB","url":"https://www.ibm.com/support/pages/node/7268744"},{"type":"WEB","url":"https://www.ibm.com/support/pages/node/7268745"},{"type":"WEB","url":"https://www.ibm.com/support/pages/node/7268747"},{"type":"WEB","url":"https://access.redhat.com/errata/RHSA-2026:14087"},{"type":"WEB","url":"https://access.redhat.com/errata/RHSA-2026:17083"},{"type":"WEB","url":"https://www.ibm.com/support/pages/node/7274746"},{"type":"WEB","url":"https://www.ibm.com/support/pages/node/7275963"},{"type":"WEB","url":"https://www.ibm.com/support/pages/node/7278339"},{"type":"WEB","url":"https://www.ibm.com/support/pages/node/7280541"},{"type":"WEB","url":"https://www.ibm.com/support/pages/node/7290733"},{"type":"WEB","url":"https://www.ibm.com/support/pages/node/7290698"},{"type":"WEB","url":"https://www.ibm.com/support/pages/node/7293833"}]},{"provider":"csaf-bsi","source_id":"WID-SEC-W-2026-2933","relation":"upstream","url":"https://wid.cert-bund.de/portal/wid/securityadvisory?name=WID-SEC-2026-2933","license":"TLP:CLEAR, mirroring permitted","published_at":"2026-08-19T22:00:00Z","modified_at":"2026-11-02T23:00:00Z","summary":"Splunk SOAR: Mehrere Schwachstellen","details":"Ein Angreifer kann mehrere Schwachstellen in Splunk SOAR ausnutzen, um Sicherheitsvorkehrungen zu umgehen, um Informationen offenzulegen, um Dateien zu manipulieren, um einen SQL-Injection Angriff durchzuführen, um einen Cross-Site Scripting Angriff durchzuführen, und um beliebigen Programmcode auszuführen.\n\nSplunk SOAR ist eine Sicherheitsautomatisierungs- und Reaktionsplattform, die es Unternehmen ermöglicht, Sicherheitsvorfälle zu orchestrieren und zu automatisieren.","severity":[{"type":"BSI","score":"hoch","source":"WID-SEC-W-2026-2933"}],"affected":[],"product_status":[],"references":[{"type":"WEB","url":"https://wid.cert-bund.de/.well-known/csaf/white/2026/wid-sec-w-2026-2933.json"},{"type":"WEB","url":"https://wid.cert-bund.de/portal/wid/securityadvisory?name=WID-SEC-2026-2933"},{"type":"WEB","url":"https://advisory.splunk.com/advisories/SVD-2026-0804"},{"type":"WEB","url":"https://advisory.splunk.com/advisories/SVD-2026-0805"},{"type":"WEB","url":"https://access.redhat.com/errata/RHSA-2026:63385"},{"type":"WEB","url":"https://access.redhat.com/errata/RHSA-2026:71179"},{"type":"WEB","url":"https://access.redhat.com/errata/RHSA-2026:71210"},{"type":"WEB","url":"https://access.redhat.com/errata/RHSA-2026:59153"},{"type":"WEB","url":"https://www.ibm.com/support/pages/node/7291610"},{"type":"WEB","url":"https://www.ibm.com/support/pages/node/7292374"},{"type":"WEB","url":"https://linux.oracle.com/errata/ELSA-2026-604898.html"},{"type":"WEB","url":"https://www.ibm.com/support/pages/node/7293833"},{"type":"WEB","url":"https://lists.debian.org/debian-security-announce/2026/msg00513.html"},{"type":"WEB","url":"https://access.redhat.com/errata/RHSA-2026:93440"},{"type":"WEB","url":"https://www.ibm.com/support/pages/node/7295132"}]},{"provider":"osv","source_id":"CLSA-2026-1787657292","relation":"upstream","url":"https://osv.dev/vulnerability/CLSA-2026-1787657292","published_at":"2026-08-25T11:28:12Z","modified_at":"2026-10-15T09:48:03.101758Z","summary":"TuxCare security update for koa (4 CVEs)","details":"TuxCare rebuilt koa to address 4 CVEs. Fixed in 2.15.3-tuxcare.1.","severity":[],"affected":[{"ecosystem":"TuxCare:npm","package":"koa","purl":"pkg:npm/koa","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.15.3-tuxcare.0"},{"fixed":"2.15.3-tuxcare.1"}]}],"versions":["2.15.3"],"fixed":["2.15.3-tuxcare.1"],"provider":"osv","source":"CLSA-2026-1787657292","relation":"upstream"}],"product_status":[],"references":[]},{"provider":"osv","source_id":"CLSA-2026-1792779347","relation":"upstream","url":"https://osv.dev/vulnerability/CLSA-2026-1792779347","published_at":"2026-10-23T18:15:47Z","modified_at":"2026-10-23T19:15:09.373866Z","summary":"TuxCare security update for koa (4 CVEs)","details":"TuxCare rebuilt koa to address 4 CVEs. Fixed in 2.15.4-tuxcare.1.","severity":[],"affected":[{"ecosystem":"TuxCare:npm","package":"koa","purl":"pkg:npm/koa","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.15.4-tuxcare.0"},{"fixed":"2.15.4-tuxcare.1"}]}],"versions":["2.15.4"],"fixed":["2.15.4-tuxcare.1"],"provider":"osv","source":"CLSA-2026-1792779347","relation":"upstream"}],"product_status":[],"references":[]},{"provider":"cvelistv5","source_id":"CVE-2026-27959","relation":"self","url":"https://www.cve.org/CVERecord?id=CVE-2026-27959","license":"CC-BY-4.0","published_at":"2026-02-26T01:45:45.668Z","modified_at":"2026-07-15T01:12:18.807Z","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.","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","source":"CVE-2026-27959"},{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N","source":"redhat-SADP:CVE-2026-27959"}],"affected":[{"ecosystem":"CVE","package":"koajs/koa","versions":[">= 3.0.0, < 3.1.2","< 2.16.4"],"provider":"cvelistv5","source":"CVE-2026-27959","relation":"self"}],"product_status":[],"references":[{"type":"WEB","url":"https://github.com/koajs/koa/security/advisories/GHSA-7gcc-r8m5-44qm"},{"type":"WEB","url":"https://github.com/koajs/koa/commit/55ab9bab044ead4e82c70a30a4f9dc0fc9c1b6df"},{"type":"WEB","url":"https://github.com/koajs/koa/commit/b76ddc01fdb703e51652b0fd131d16394cadcfeb"}]},{"provider":"nvd","source_id":"CVE-2026-27959","relation":"self","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-27959","severity":[],"affected":[{"ecosystem":"NVD","package":"koajs:koa","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.16.4"}]},{"type":"ECOSYSTEM","events":[{"introduced":"3.0.0"},{"fixed":"3.1.2"}]}],"fixed":["2.16.4","3.1.2"],"provider":"nvd","source":"CVE-2026-27959","relation":"self"}],"product_status":[],"references":[]},{"provider":"osv","source_id":"CLSA-2026-1788264598","relation":"self","url":"https://osv.dev/vulnerability/CLSA-2026-1788264598","published_at":"2026-09-01T12:09:58Z","modified_at":"2026-10-15T09:47:55.436659Z","summary":"TuxCare security update for koa (1 CVE)","details":"TuxCare rebuilt koa to address 1 CVE. Fixed in 1.7.1-tuxcare.3.","severity":[],"affected":[{"ecosystem":"TuxCare:npm","package":"koa","purl":"pkg:npm/koa","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"1.7.1-tuxcare.0"},{"fixed":"1.7.1-tuxcare.3"}]}],"versions":["1.7.1","1.7.1-tuxcare.1","1.7.1-tuxcare.2"],"fixed":["1.7.1-tuxcare.3"],"provider":"osv","source":"CLSA-2026-1788264598","relation":"self"}],"product_status":[],"references":[]},{"provider":"osv","source_id":"GHSA-7gcc-r8m5-44qm","relation":"self","url":"https://osv.dev/vulnerability/GHSA-7gcc-r8m5-44qm","license":"CC-BY-4.0","published_at":"2026-02-26T22:42:57Z","modified_at":"2026-02-26T23:41:18.848183Z","summary":"Koa has Host Header Injection via ctx.hostname","details":"## Summary\n\nKoa'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 (e.g., `evil.com:fake@legitimate.com`) 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.\n\n## Details\n\nThe vulnerability exists in Koa's hostname getter in `lib/request.js`:\n\n```javascript\n// Koa 2.16.1 - lib/request.js\nget hostname() {\n  const host = this.host;\n  if (!host) return '';\n  if ('[' === host[0]) return this.URL.hostname || ''; // IPv6 literal\n  return host.split(':', 1)[0];\n}\n```\n\nThe `host` getter retrieves the raw header value with HTTP/2 and proxy support:\n\n```javascript\n// Koa 2.16.1 - lib/request.js\nget host() {\n  const proxy = this.app.proxy;\n  let host = proxy && this.get('X-Forwarded-Host');\n  if (!host) {\n    if (this.req.httpVersionMajor >= 2) host = this.get(':authority');\n    if (!host) host = this.get('Host');\n  }\n  if (!host) return '';\n  return host.split(',')[0].trim();\n}\n```\n\n### The Problem\n\nThe parsing logic simply splits on the first `:` and returns the first segment. There is no validation that the resulting string is a valid hostname per RFC 3986 Section 3.2.2.\n\n**RFC 3986 Section 3.2.2** defines the host component as:\n\n```\nhost = IP-literal / IPv4address / reg-name\nreg-name = *( unreserved / pct-encoded / sub-delims )\nunreserved = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\nsub-delims = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\" / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n```\n\nThe `@` character is explicitly NOT permitted in the host component - it is the delimiter separating userinfo from host in the authority component.\n\n### Attack Vector\n\nWhen an attacker sends:\n\n```\nHost: evil.com:fake@legitimate.com:3000\n```\n\nKoa parses this as:\n\n| API | Returns | Notes |\n|-----|---------|-------|\n| `ctx.get('Host')` | `\"evil.com:fake@legitimate.com:3000\"` | Raw header |\n| `ctx.hostname` | `\"evil.com\"` | **Attacker-controlled** |\n| `ctx.host` | `\"evil.com:fake@legitimate.com:3000\"` | Raw header value |\n| `ctx.origin` | `\"http://evil.com:fake@legitimate.com:3000\"` | Protocol + malformed host |\n\nThe `ctx.hostname` API returns `evil.com` because the parser splits on the first `:` without understanding that `evil.com:fake@legitimate.com` is a malformed authority component where `evil.com:fake` would be interpreted as userinfo by a proper URI parser.\n\n### Additional Concern: `ctx.origin`\n\nKoa's `ctx.origin` property concatenates protocol and host without validation:\n\n```javascript\n// lib/request.js\nget origin() {\n  return `${this.protocol}://${this.host}`;\n}\n```\n\nApplications using `ctx.origin` for URL generation receive the full malformed Host header value, creating URLs with embedded credentials that browsers may interpret as userinfo.\n\n### HTTP/2 Consideration\n\nKoa explicitly checks `httpVersionMajor >= 2` to read the `:authority` pseudo-header:\n\n```javascript\nif (this.req.httpVersionMajor >= 2) host = this.get(':authority');\n```\n\nThe same vulnerability applies - malformed `:authority` values containing userinfo would be accepted and parsed identically.\n\n## PoC\n\n### Setup\n\n```javascript\n// server.js\nconst Koa = require('koa'); \nconst app = new Koa();\n\n// Simulates password reset URL generation (common vulnerable pattern)\napp.use(async ctx => {\n  if (ctx.path === '/forgot-password') {\n    const resetToken = 'abc123securtoken';\n    const resetUrl = `${ctx.protocol}://${ctx.hostname}/reset?token=${resetToken}`;\n    \n    ctx.body = {\n      message: 'Password reset link generated',\n      resetUrl: resetUrl,\n      debug: {\n        rawHost: ctx.get('Host'),\n        parsedHostname: ctx.hostname,\n        origin: ctx.origin,\n        protocol: ctx.protocol\n      }\n    };\n  }\n});\n\napp.listen(3000, () => console.log('Server on http://localhost:3000'));\n```\n\n### Exploit\n\n```bash\ncurl -H \"Host: evil.com:fake@localhost:3000\" http://localhost:3000/forgot-password\n```\n\n### Result\n\n```json\n{\n  \"message\": \"Password reset link generated\",\n  \"resetUrl\": \"http://evil.com/reset?token=abc123securtoken\",\n  \"debug\": {\n    \"rawHost\": \"evil.com:fake@localhost:3000\",\n    \"parsedHostname\": \"evil.com\",\n    \"origin\": \"http://evil.com:fake@localhost:3000\",\n    \"protocol\": \"http\"\n  }\n}\n```\n\nThe password reset URL points to `evil.com` instead of the legitimate server. In a real attack:\n\n1. Attacker requests password reset for victim's email with malicious Host header\n2. Server generates reset link using `ctx.hostname` → `https://evil.com/reset?token=SECRET`\n3. Victim receives email with poisoned link\n4. Victim clicks link, token is sent to attacker's server\n5. Attacker uses token to reset victim's password\n\n### Additional Test Cases\n\n```bash\n# Basic injection\ncurl -H \"Host: evil.com:x@legitimate.com\" http://localhost:3000/forgot-password\n# Result: hostname = \"evil.com\"\n\n# With port preservation attempt\ncurl -H \"Host: evil.com:443@legitimate.com:3000\" http://localhost:3000/forgot-password  \n# Result: hostname = \"evil.com\"\n\n# Unicode/encoded variations\ncurl -H \"Host: evil.com:x%40legitimate.com\" http://localhost:3000/forgot-password\n# Result: hostname = \"evil.com\"\n```\n\n### Deployment Consideration\n\nFor this attack to succeed in production, the malicious Host header must reach the Koa application. This occurs when:\n\n1. **No reverse proxy** - Application directly exposed to internet\n2. **Misconfigured proxy** - Proxy doesn't override/validate Host header\n3. **Proxy trust enabled** (`app.proxy = true`) - `X-Forwarded-Host` can be injected\n4. **Default virtual host** - Server is the catch-all for unrecognized Host headers\n\n## Impact\n\n### Vulnerability Type\n\n- CWE-20: Improper Input Validation\n- CWE-644: Improper Neutralization of HTTP Headers for Scripting Syntax\n\n### Attack Scenarios\n\n**1. Password Reset Poisoning (High Severity)**\n- Attacker hijacks password reset tokens by poisoning reset URLs\n- Requires victim to click link in email\n- Results in account takeover\n\n**2. Email Verification Bypass**\n- Attacker poisons email verification links\n- Can verify attacker-controlled email on victim accounts\n\n**3. OAuth/SSO Callback Manipulation**\n- Applications using `ctx.hostname` for OAuth redirect URIs\n- Attacker redirects OAuth callbacks to malicious server\n- Results in token theft\n\n**4. Web Cache Poisoning**\n- If responses are cached without Host in cache key\n- Poisoned URLs served to all users\n- Persistent XSS/phishing via cached responses\n\n**5. Server-Side Request Forgery (SSRF)**\n- Internal routing decisions based on `ctx.hostname`\n- Attacker manipulates which backend receives requests\n\n### Who Is Impacted\n\n- **Direct impact**: Any Koa application using `ctx.hostname` or `ctx.origin` for URL generation without additional validation\n- **Common patterns**: Password reset, email verification, webhook URL generation, multi-tenant routing, OAuth implementations","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","source":"GHSA-7gcc-r8m5-44qm"}],"affected":[{"ecosystem":"npm","package":"koa","purl":"pkg:npm/koa","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"2.16.4"}]}],"fixed":["2.16.4"],"provider":"osv","source":"GHSA-7gcc-r8m5-44qm","relation":"self"},{"ecosystem":"npm","package":"koa","purl":"pkg:npm/koa","ranges":[{"type":"SEMVER","events":[{"introduced":"3.0.0"},{"fixed":"3.1.2"}]}],"fixed":["3.1.2"],"provider":"osv","source":"GHSA-7gcc-r8m5-44qm","relation":"self"}],"product_status":[],"references":[{"type":"WEB","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":"WEB","url":"https://github.com/koajs/koa/commit/55ab9bab044ead4e82c70a30a4f9dc0fc9c1b6df"},{"type":"WEB","url":"https://github.com/koajs/koa/commit/b76ddc01fdb703e51652b0fd131d16394cadcfeb"},{"type":"PACKAGE","url":"https://github.com/koajs/koa"}]},{"provider":"redhat-vex","source_id":"CVE-2026-27959","relation":"self","url":"https://access.redhat.com/security/cve/CVE-2026-27959","license":"CC-BY-4.0","published_at":"2026-02-26T01:45:45.668Z","modified_at":"2026-03-23T14:11:47Z","summary":"koa: Koa: Host header injection vulnerability due to malformed HTTP Host header parsing","details":"A flaw was found in Koa’s ctx.hostname API used in Node.js applications. The function incorrectly parses specially crafted HTTP Host headers containing an @ character, which can cause the extracted hostname value to differ from the intended origin. An attacker can exploit this behavior by sending a malicious Host header to influence the hostname value returned by ctx.hostname. Applications that rely on this value for generating absolute URLs, password reset links, or email verification links without additional validation may be susceptible to Host header injection attacks.","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N","source":"CVE-2026-27959"},{"type":"Red Hat","score":"Important","source":"CVE-2026-27959"}],"affected":[],"product_status":[{"vendor":"Red Hat","product":"Red Hat Developer Hub 1","cpe":"cpe:/a:redhat:rhdh:1","status":"affected","packages":["rhdh/rhdh-hub-rhel9"],"package_count":1,"fixed":[],"advisories":[],"note":"Will not fix","provider":"redhat-vex","source":"CVE-2026-27959"},{"vendor":"Red Hat","product":"Red Hat OpenShift AI (RHOAI)","cpe":"cpe:/a:redhat:openshift_ai","status":"affected","packages":["rhoai/odh-mod-arch-gen-ai-rhel9"],"package_count":1,"fixed":[],"advisories":[],"note":"Out of support scope","provider":"redhat-vex","source":"CVE-2026-27959"},{"vendor":"Red Hat","product":"Red Hat OpenShift AI 2.25","cpe":"cpe:/a:redhat:openshift_ai:2.25::el9","status":"fixed","packages":["rhoai"],"package_count":1,"fixed":[],"advisories":["RHSA-2026:10184"],"provider":"redhat-vex","source":"CVE-2026-27959"},{"vendor":"Red Hat","product":"Red Hat OpenShift AI 2.25","cpe":"cpe:/a:redhat:openshift_ai:2.25::el9","status":"not_affected","packages":["rhoai"],"package_count":1,"fixed":[],"advisories":[],"note":"vulnerable_code_not_present","provider":"redhat-vex","source":"CVE-2026-27959"},{"vendor":"Red Hat","product":"Red Hat OpenShift Container Platform 4.19","cpe":"cpe:/a:redhat:openshift:4.19::el9","status":"fixed","packages":["openshift4"],"package_count":1,"fixed":[],"advisories":["RHSA-2026:7249"],"provider":"redhat-vex","source":"CVE-2026-27959"},{"vendor":"Red Hat","product":"Red Hat OpenShift Container Platform 4.19","cpe":"cpe:/a:redhat:openshift:4.19::el9","status":"not_affected","packages":["openshift4"],"package_count":1,"fixed":[],"advisories":[],"note":"vulnerable_code_not_present","provider":"redhat-vex","source":"CVE-2026-27959"},{"vendor":"Red Hat","product":"Red Hat OpenShift Dev Spaces","cpe":"cpe:/a:redhat:openshift_devspaces:3","status":"not_affected","packages":["devspaces/code-rhel9"],"package_count":1,"fixed":[],"advisories":[],"note":"component_not_present","provider":"redhat-vex","source":"CVE-2026-27959"},{"vendor":"Red Hat","product":"Self-service automation portal 2","cpe":"cpe:/a:redhat:ansible_portal:2","status":"affected","packages":["ansible-automation-platform/automation-portal"],"package_count":1,"fixed":[],"advisories":[],"note":"Affected","provider":"redhat-vex","source":"CVE-2026-27959"}],"references":[{"type":"WEB","url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-27959.json"},{"type":"WEB","url":"https://access.redhat.com/security/cve/CVE-2026-27959"},{"type":"WEB","url":"https://bugzilla.redhat.com/show_bug.cgi?id=2442928"},{"type":"WEB","url":"https://www.cve.org/CVERecord?id=CVE-2026-27959"},{"type":"WEB","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-27959"},{"type":"WEB","url":"https://github.com/koajs/koa/commit/55ab9bab044ead4e82c70a30a4f9dc0fc9c1b6df"},{"type":"WEB","url":"https://github.com/koajs/koa/commit/b76ddc01fdb703e51652b0fd131d16394cadcfeb"},{"type":"WEB","url":"https://github.com/koajs/koa/security/advisories/GHSA-7gcc-r8m5-44qm"}]}],"references":[{"type":"WEB","url":"https://github.com/koajs/koa/security/advisories/GHSA-7gcc-r8m5-44qm"},{"type":"WEB","url":"https://github.com/koajs/koa/commit/55ab9bab044ead4e82c70a30a4f9dc0fc9c1b6df"},{"type":"WEB","url":"https://github.com/koajs/koa/commit/b76ddc01fdb703e51652b0fd131d16394cadcfeb"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-27959"},{"type":"PACKAGE","url":"https://github.com/koajs/koa"},{"type":"WEB","url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-27959.json"},{"type":"WEB","url":"https://access.redhat.com/security/cve/CVE-2026-27959"},{"type":"WEB","url":"https://bugzilla.redhat.com/show_bug.cgi?id=2442928"},{"type":"WEB","url":"https://www.cve.org/CVERecord?id=CVE-2026-27959"}],"sources":[{"provider":"csaf-bsi","source_id":"WID-SEC-W-2026-1007","url":"https://wid.cert-bund.de/portal/wid/securityadvisory?name=WID-SEC-2026-1007","license":"TLP:CLEAR, mirroring permitted","modified_at":"2026-10-25T23:00:00Z","relation":"upstream"},{"provider":"csaf-bsi","source_id":"WID-SEC-W-2026-2933","url":"https://wid.cert-bund.de/portal/wid/securityadvisory?name=WID-SEC-2026-2933","license":"TLP:CLEAR, mirroring permitted","modified_at":"2026-11-02T23:00:00Z","relation":"upstream"},{"provider":"osv","source_id":"CLSA-2026-1787657292","url":"https://osv.dev/vulnerability/CLSA-2026-1787657292","modified_at":"2026-10-15T09:48:03.101758Z","relation":"upstream"},{"provider":"osv","source_id":"CLSA-2026-1792779347","url":"https://osv.dev/vulnerability/CLSA-2026-1792779347","modified_at":"2026-10-23T19:15:09.373866Z","relation":"upstream"},{"provider":"cvelistv5","source_id":"CVE-2026-27959","url":"https://www.cve.org/CVERecord?id=CVE-2026-27959","license":"CC-BY-4.0","modified_at":"2026-07-15T01:12:18.807Z","relation":"self"},{"provider":"nvd","source_id":"CVE-2026-27959","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-27959","relation":"self"},{"provider":"osv","source_id":"CLSA-2026-1788264598","url":"https://osv.dev/vulnerability/CLSA-2026-1788264598","modified_at":"2026-10-15T09:47:55.436659Z","relation":"self"},{"provider":"osv","source_id":"GHSA-7gcc-r8m5-44qm","url":"https://osv.dev/vulnerability/GHSA-7gcc-r8m5-44qm","license":"CC-BY-4.0","modified_at":"2026-02-26T23:41:18.848183Z","relation":"self"},{"provider":"redhat-vex","source_id":"CVE-2026-27959","url":"https://access.redhat.com/security/cve/CVE-2026-27959","license":"CC-BY-4.0","modified_at":"2026-03-23T14:11:47Z","relation":"self"}]}
