{"answers":{"affected":"4 open source packages ship an affected version, including koa. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-27959 exists.","fix":"Upgrade koa to a fixed version for your release line: 2.16.4 or 3.1.2.","what":"CVE-2026-27959 is a high-severity vulnerability in koajs koa, published on 26 Feb 2026. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2026-27959 and fix it if it is affected.\n\nWhat it is: CVE-2026-27959 is a high-severity vulnerability in koajs koa, published on 26 Feb 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-27959 exists.\n\nAffected packages and fixed versions:\n- koa (npm): affected all versions; fixed in 2.16.4\n- koa (npm): affected all versions; fixed in 2.16.4\n- koa (npm): affected from 3.0.0; fixed in 3.1.2\n- koa (npm): affected from 3.0.0; fixed in 3.1.2\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2026-27959/ (Markdown: https://insights.sbomify.com/CVE-2026-27959/index.md)","id":"CVE-2026-27959","markdown":"https://insights.sbomify.com/CVE-2026-27959/index.md","name":"CVE-2026-27959","record":{"aliases":["CLSA-2026-1788264598","GHSA-7gcc-r8m5-44qm","ROOT-APP-NPM-CVE-2026-27959"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["security_bypass","account_takeover"],"network_reachable":"yes","non_default_config":false,"product_category":"Node.js web framework","requires_auth":"none","summary":"Koa's hostname parsing flaw allows Host header injection, enabling attackers to manipulate generated URLs for password resets or routing.","user_interaction":"not_required","vuln_class":"other"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"koa","vendor":"koajs"}],"cvss":{"score":7.5,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","version":"3.1"},"cwes":[{"id":"CWE-20","name":"Improper Input Validation"}],"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.","ecosystems":["npm"],"exploits":{"exploitdb":0,"first_seen":"2026-03-09","github_poc":1,"max_poc_stars":0,"metasploit":0,"nuclei":0,"refs":[{"date":"2026-03-09T19:22:55Z","kind":"github_poc","ref":"https://github.com/mlouazir/CVE-2026-27959-mini-lab","stars":0,"title":null}],"tier":"weaponised"},"has_fix":true,"headline":"Koa has Host Header Injection via `ctx.hostname`","id":"CVE-2026-27959","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":null,"products":[],"type":"other","year":"2026"},"n_packages":4,"n_references":3,"next":{"headline":"OpenCTI privilege escalation and unauthenticated access via default admin account","id":"CVE-2026-27960"},"packages":[{"ecosystem":"npm","fixed":["2.16.4"],"introduced":["0"],"last_affected":[],"package":"koa","purl":null,"source":"GHSA-7gcc-r8m5-44qm"},{"ecosystem":"npm","fixed":["2.16.4"],"introduced":["0"],"last_affected":[],"package":"koa","purl":"pkg:npm/koa","source":"GHSA-7gcc-r8m5-44qm"},{"ecosystem":"npm","fixed":["3.1.2"],"introduced":["3.0.0"],"last_affected":[],"package":"koa","purl":null,"source":"GHSA-7gcc-r8m5-44qm"},{"ecosystem":"npm","fixed":["3.1.2"],"introduced":["3.0.0"],"last_affected":[],"package":"koa","purl":"pkg:npm/koa","source":"GHSA-7gcc-r8m5-44qm"}],"prev":{"headline":"Coolify: Authenticated RCE via command injection in CA certificate management feature","id":"CVE-2026-27957"},"products":["koa"],"published":"2026-02-26","related":[{"cvss_score":9.2,"headline":"Koa has Inefficient Regular Expression Complexity","id":"CVE-2025-25200","kev_date_added":null,"published":"2025-02-12"},{"cvss_score":5.1,"headline":"KoaJS Koa HTTP Header response.js back redirect","id":"CVE-2025-8129","kev_date_added":null,"published":"2025-07-25"},{"cvss_score":5,"headline":"XSS at ctx.redirect() function in Koajs","id":"CVE-2025-32379","kev_date_added":null,"published":"2025-04-09"},{"cvss_score":4.3,"headline":"Koa Vulnerable to Open Redirect via Trailing Double-Slash (//) in back Redirect Logic","id":"CVE-2025-62595","kev_date_added":null,"published":"2025-10-21"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"},{"class":"open","licence":"CC0","name":"PoC-in-GitHub"}],"ssvc":{"automatable":"yes","exploitation":"poc","technical_impact":"partial"},"state":"PUBLISHED","updated":"2026-07-15","vendors":["koajs"]},"summary":"Koa's hostname parsing flaw allows Host header injection, enabling attackers to manipulate generated URLs for password resets or routing.","url":"https://insights.sbomify.com/CVE-2026-27959/"}