Skip to main content

Koa CVE-2025-62595

MEDIUM
URL Redirection to Untrusted Site (Open Redirect) (CWE-601)
2025-10-21 security-advisories@github.com
6.1
CVSS 3.1 · NVD
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Lure victim to vulnerable Koa endpoint
  2. Delivery
    Supply protocol-relative Referer (//evil.com)
  3. Exploit
    ctx.back() treats // as safe relative path
  4. Execution
    Server returns Location: //evil.com
  5. Persist
    Browser redirects to attacker site
  6. Impact
    Phishing/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.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

npm koa fix: 2.16.3, 3.0.3

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

NVD PRIMARY 6.1 MEDIUM
AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
vuln.today AI 6.1 MEDIUM

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.

3.1 AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
4.0 AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
Red Hat 4.3 MEDIUM

Primary rating from NVD.

CVSS VectorNVD

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

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

EPSS Score
0.3%
Top 80% exploitable
Prevalence
Medium
popular Node.js web framework but niche back() redirect feature; far smaller than Express
Exploit
POC
Public exploit code exists
Data Quality
4 sources
Confidence: Medium

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.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC Yes
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
Poc
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

50
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +30
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Affected Products (CPE)NVD

cpe:2.3:a:koajs:koa:*:*:*:*:*:node.js:*:*
cpe:2.3:a:koajs:koa:2.16.2:*:*:*:*:node.js:*:*

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy