LiveActive security incident?Get immediate response
CVE Record

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

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.

HighCVSS 8.2Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

Koa apps that trust ctx.hostname can be tricked into using an attacker-controlled hostname from a malformed Host header. Business risk is highest where that value appears in password reset links, email verification, redirects, tenant routing, or security decisions. The issue is fixed in Koa 3.1.2 and 2.16.4.

Executive priority

Treat as high priority for customer-facing applications using Koa. Prioritize authentication, account recovery, onboarding, and multi-tenant routing services because hostname confusion can undermine trust workflows even without server compromise.

Technical view

Before Koa 3.1.2 and 2.16.4, ctx.hostname naively parsed the Host header by taking text before the first colon and did not validate RFC 3986 hostname syntax. A malformed header containing @ could cause ctx.hostname to return attacker-controlled hostname data. CVSS 3.1 is 8.2, CWE-20.

Likely exposure

Exposure is likely in internet-facing Node.js services using vulnerable Koa versions and referencing ctx.hostname in user-visible links, redirects, routing, or trust decisions. Koa deployments that never use ctx.hostname for those purposes have lower practical risk, but should still upgrade.

Exploitation context

The source bundle does not show CISA KEV listing or confirmed active exploitation. The advisory describes a network-reachable, unauthenticated condition with low attack complexity, but no source here proves exploitation in the wild.

Researcher notes

The issue is input validation failure in hostname parsing, tracked as CWE-20. Analysis should focus on data flow from ctx.hostname into security-sensitive outputs. Evidence in the bundle identifies fixed versions and commits, but does not include exploit proof-of-concept or active exploitation confirmation.

Mitigation direction

  • Upgrade Koa 3.x to 3.1.2 or later.
  • Upgrade Koa 2.x to 2.16.4 or later.
  • Avoid deriving public URLs from request Host headers.
  • Use a configured canonical base URL for emails and redirects.
  • Validate allowed hostnames at the edge or application entry point.
  • Track vendor and Red Hat guidance for downstream package status.

Validation and detection

  • Inventory Node.js services for Koa dependency versions.
  • Search application code for ctx.hostname usage.
  • Review password reset and verification link generation paths.
  • Confirm generated links use configured trusted hostnames.
  • Review logs for malformed or unexpected Host header patterns.
  • Verify Red Hat advisories if using downstream packaged Koa.
Prepared
Confidence
high
Sources
10

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · low confidence lookup

CWE-20: Exact CWE lookup

Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
description · low confidence lookup

Credential and access behavior lookup

The CVE wording references authentication or credential exposure, so valid-account and credential-access review may help. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2026-27959 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
High
CVSS
8.2 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

2CVSS vectors
5Timeline events
2ADP providers
9Source links

SSVC decision data

CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: pocAutomatable: yesTechnical Impact: partial

CVSS vector scores

2 official scores

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
8.2CVSS 3.1HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N3.94.2redhat-SADP
7.5CVSS 3.1HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N3.93.6GitHub_M

Vulnerability scoring details

Base CVSS 3.1 score

8.2High
CVSS 3.1 vector shape for CVE-2026-27959Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone

Vulnerability timeline

Timeline events are normalized from CVE metadata, CNA source timelines, ADP timelines, and KEV metadata when present.

  1. CVE reservedCVE Program

    The CVE ID was reserved by the assigning CNA.

  2. ADP timelineredhat-SADP

    Made public.

  3. CVE publishedCVE Program

    The CVE record was published.

  4. ADP timelineredhat-SADP

    Reported to Red Hat.

  5. CVE updatedCVE Program

    The CVE record metadata indicates this as the latest update time.

ADP provider summaries

CISA-ADPCISA ADP Vulnrichment
other:ssvc
redhat-SADPkoa: Koa: Host header injection vulnerability due to malformed HTTP Host header parsing
other:Red Hat severity ratingcvssV3_1
  • 2026-02-26T03:01:14.695Z: Reported to Red Hat.
  • 2026-02-26T01:45:45.668Z: Made public.

Source materials

Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
koajskoa>= 3.0.0, < 3.1.2, < 2.16.4Listed
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-20 · source CWE mapping

Improper Input Validation

Improper Input Validation represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.