cve.bz

CVE-2026-27959 koajs koa: Improper Input Validation

7.5 highExploit referenceEPSS 0.4%Fix available

High (7.5) in koajs koa. EPSS 0.4% estimated probability of exploitation activity in the next 30 days. Fixed in koa 2.16.4, 3.1.2.

On this page
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

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
EPSS
0.4% (unchanged from 0.4% a week ago; 0.5% 30 days ago) estimated probability of exploitation activity in the next 30 days; 35th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: PoC · Automatable: yes · Technical impact: partial, assessed 2026-02-26. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-20 Improper Input Validation
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2026-27959 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-27959?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-27959?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-27959 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
koajs:koabefore 2.16.4
koajs:koafrom 3.0.0 before 3.1.2

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-7gcc-r8m5-44qmnpmkoa>=3.0.0 <3.1.23.1.2
GHSA-7gcc-r8m5-44qmnpmkoa<2.16.42.16.4

Red Hat

Red Hat rates this Important.

Red Hat's statement

Red Hat Product Security considers this issue as High severity.

A remote, unauthenticated attacker can send a specially crafted HTTP Host header containing a valid RFC 3986 userinfo component (using the @ delimiter). Due to improper parsing of the authority field in the ctx.hostname API, the application may treat attacker-controlled input as the hostname value. Exploitation occurs when the server processes the malicious request and does not require user interaction (UI:N).

Applications that rely on ctx.hostname to construct absolute URLs, such as: password reset links, email verification links, OAuth redirect URIs, or webhook endpoints, may generate security sensitive URLs that reference an attacker controlled domain. This can result in integrity violations, including manipulation of authentication flows or account takeover scenarios. Integrity impact is therefore rated High.

Confidentiality impact is considered Low because disclosure of sensitive data depends on application-specific usage patterns. The vulnerability does not automatically expose information from the server. However, if an affected application uses the manipulated hostname value to generate security-sensitive links such as password reset or email verification URLs and embeds tokens in those links without additional validation, a victim who later follows such a link may inadvertently disclose those tokens to an attacker controlled domain. Such disclosure is conditional, application-dependent like how the application constructs URLs. Also, the subsequent user interaction beyond the initial exploitation, the confidentiality impact is assessed as Low (C:L).

Red Hat's mitigation

Red Hat is not aware of a practical temporary workaround that fully mitigates this issue or meets Red Hat Product Security's standards for usability, deployment, applicability, or stability. Customers are advised to apply the relevant security updates once they become available.

ProductPackageStateAdvisory
Red Hat OpenShift AI 2.25rhoai/odh-dashboard-rhel9:1776742021Fixed 2026-04-23RHSA-2026:10184
Red Hat OpenShift AI 2.25rhoai/odh-mod-arch-model-registry-rhel9:1776742141Fixed 2026-04-23RHSA-2026:10184
Red Hat OpenShift Container Platform 4.19openshift4/ose-monitoring-plugin-rhel9:1775577192Fixed 2026-04-16RHSA-2026:7249
Red Hat Developer Hub 1rhdh/rhdh-hub-rhel9Will not fix
Red Hat OpenShift AI (RHOAI)rhoai/odh-mod-arch-gen-ai-rhel9Out of support scope
Red Hat OpenShift Dev Spacesdevspaces/code-rhel9Not affected
Self-service automation portal 2ansible-automation-platform/automation-portalAffected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2026-27959.

GitHub PoC (unverified)

Repositories on GitHub named after this CVE. Nobody has checked them and they are not scanned: some hold a working proof of concept, some nothing useful, and some malware made to look like one. Read the code before you run any of it.

Attack patterns (CAPEC)

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits. More on the page of CWE-20 (51).

References

Check your stackJSON