Koa
CVE-2025-62595
MEDIUM
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessLure victim to vulnerable Koa endpoint
-
DeliverySupply protocol-relative Referer (//evil.com)
-
Exploitctx.back() treats // as safe relative path
-
ExecutionServer returns Location: //evil.com
-
PersistBrowser redirects to attacker site
-
ImpactPhishing/credential harvest
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V3 - Web Frontend Security Redirect URL validation
MITRE ATT&CK
1 technique across 1 tactic: Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | The affected application must call Koa's ctx.back() helper (the back-redirect feature in lib/response.js), which reads the Referer/referrer header to decide where to redirect. The specific exploitable condition: a protocol-relative URL (e.g. '//evil.com' or '//evil.com/login/' with trailing double-slash) is wrongly matched by the startsWith('/') check and treated as a safe relative path, so it is emitted verbatim in the Location header. Limiting factors: exploitation requires user interaction (UI:R) - the victim must follow the attacker's link/flow; it is ineffective against Koa apps that do not use ctx.back(); and impact is confined to redirecting the browser (phishing/social engineering), not server compromise. No authentication is required (PR:N). |
| Impact | This is a genuinely moderate (not critical) issue, and the multiple signals agree rather than conflict. The CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N, base 6.1) describes a classic CWE-601 open redirect: network-reachable, low complexity, no authentication, but requiring user interaction, with only limited confidentiality/integrity impact and a scope change to the victim's browser. The EPSS score is low (0.29%, 20th percentile), consistent with an open redirect that aids phishing but does not yield direct code execution or data compromise. This CVE is NOT on CISA KEV, so there is no evidence of active exploitation; however, publicly available exploit code exists (the GHSA advisory includes a working curl PoC and the patch commit tests). The key real-world limiter not captured by the high-level CVSS score is that exploitation depends entirely on the target application actually invoking Koa's ctx.back() redirect helper - many Koa apps never use it, which materially shrinks the exploitable population below what AV:N/PR:N alone implies. Net: a real but low-urgency hygiene fix (update the dependency), not an emergency, and clearly not a 'high CVSS inflated beyond reality' case since 6.1 already reflects the limited impact. |
| Exploit ScenarioDerived | An attacker crafts a link to a vulnerable Koa application and induces a victim to click it while setting (or relying on) a protocol-relative Referer value such as '//evil.com'. When the application calls ctx.back(), the framework emits 'Location: //evil.com', which browsers interpret as an absolute redirect to https://evil.com, landing the victim on an attacker-controlled phishing page. A public proof-of-concept exists in the GHSA advisory (curl -i -H "Referer: //haymiz.dev"), and because the flaw needs only user interaction with no authentication (UI:R, PR:N), it is practical to weaponize for social-engineering campaigns. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 08, 2026
An open redirect in Koa's ctx.back() helper lets remote, unauthenticated attackers force a victim's browser to an attacker-controlled site by sending a crafted Referer header containing a protocol-relative URL such as '//evil.com/login/'. Koa.js versions 2.16.2 up to (but not including) 2.16.3 and 3.0.1 up to (but not including) 3.0.3 are affected; the flaw is a bypass of the earlier fix for CVE-2025-8129/CVE-2025-54420. Publicly available exploit code and a proof-of-concept exist, but EPSS is low (0.29%, 20th percentile) and there is no confirmed active exploitation (not in CISA KEV); exploitation requires user interaction because the victim must trigger the back-redirect flow, and impact is limited to phishing/social-engineering-style redirection rather than server compromise.
RemediationAI
Upgrade to a patched release: Koa 3.0.3 (for the 3.x line) or Koa 2.16.3 (for the 2.x line). The fix is contained in commit https://github.com/koajs/koa/commit/769fd75cc6b30d72493b370b5a3ae2332ca03c5b, and the full advisory is at https://github.com/koajs/koa/security/advisories/GHSA-g8mr-fgfg-5qpc. If upgrading immediately is not possible, the most effective compensating control is to stop relying on ctx.back() for redirect decisions: replace ctx.back() with an explicit, allow-listed redirect target so the Referer header is never used to build the Location value (the trade-off is losing the automatic back-navigation convenience, which can be preserved by resolving the referrer against ctx.href with the URL API and comparing resolved.origin to the application origin before redirecting). As a secondary mitigation, applications can reject or strip Referer values that begin with '//' or normalize them before use, but this must be implemented carefully because the interpretation of protocol-relative URLs is the exact parsing edge case that caused the original bypass; blocking or validating the Referer header at a reverse proxy or middleware layer reduces exposure but does not correct the flawed logic in vulnerable library code, and it may break legitimate cross-origin referrer-based flows.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in npm
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Koa is an expressive middleware framework for Node.js built on ES2017 async functions, published to npm as 'koa' (CPE cpe:2.3:a:koajs:koa). The affected code lives in lib/response.js in the ctx.back() helper, which reads the inbound Referer/referrer header to decide where to send the client next. The root cause is CWE-601 (URL Redirection to Untrusted Site / Open Redirect): the implementation attempted to distinguish safe relative paths from absolute URLs using a simple referrer.startsWith('/') check, but protocol-relative URLs (those beginning with '//host') also start with '/'. A crafted value like '//evil.com/login/' is therefore wrongly classified as a safe relative path and emitted verbatim in the Location response header, which browsers interpret as an absolute external redirect. This is explicitly a bypass of the earlier back-redirect fix (GitHub Advisory GHSA-jgmv-j7ww-jx2x, tracked as CVE-2025-54420 and referenced in advisory GHSA-g8mr-fgfg-5qpc). The evaluated CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N reflects a network-reachable, unauthenticated condition (PR:N) that still depends on victim interaction (UI:R) and scopes the change to the browser redirect (S:C) with only low confidentiality and integrity impact. The upstream fix removed the naive startsWith('/') branch and added tests for same-origin, relative, and trailing-double-slash cases.
Know when Koa gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Network-reachable unauthenticated open redirect (AV:N/AC:L/PR:N) needing victim navigation (UI:R); redirect to attacker origin crosses a trust boundary (S:C) with limited C/I and no availability impact.
Primary rating from NVD.
CVSS VectorNVD
DescriptionNVD
Koa is expressive middleware for Node.js using ES2017 async functions. In versions 2.16.2 to before 2.16.3 and 3.0.1 to before 3.0.3, a bypass to CVE-2025-8129 was discovered in the Koa.js framework affecting its back redirect functionality. In certain circumstances, an attacker can manipulate the Referer header to force a user’s browser to navigate to an external, potentially malicious website. This occurs because the implementation incorrectly treats some specially crafted URLs as safe relative paths. Exploiting this vulnerability could allow attackers to perform phishing, social engineering, or other redirect-based attacks on users of affected applications. This issue has been patched in version 3.0.3.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Affected Products (CPE)NVD
Host header injection in Koa's ctx.hostname API (versions prior to 2.16.4 and 3.1.2) allows remote attackers to inject a
Koa is expressive middleware for Node.js using ES2017 async functions. Rated critical severity (CVSS 9.2), this vulnerab
Open redirect vulnerability in KoaJS Koa up to version 3.0.0 allows authenticated remote attackers to manipulate the Ref
Koa is expressive middleware for Node.js using ES2017 async functions. Rated medium severity (CVSS 5.0), this vulnerabil
NVD
CVE.org
EPSS
GitHub
Exploit-DB