Skip to main content

KoaJS Koa CVE-2025-8129

LOW
URL Redirection to Untrusted Site (Open Redirect) (CWE-601)
2025-07-25 cna@vuldb.com
2.0
CVSS 4.0 · NVD
View

Attack ChainAIDerived

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

  1. Recon
    Attacker injects malicious Referrer header
  2. Delivery
    Victim clicks crafted link to legitimate app
  3. Exploit
    Victim triggers back() function
  4. Install
    Koa reads unvalidated Referrer
  5. C2
    Responds with redirect to attacker domain
  6. Execute
    Browser follows Location header
  7. Impact
    User lands on phishing site

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

Exploitation requires: (1) the target application must call the back() function as part of its response logic, (2) the attacker must be able to influence or inject the Referrer header in the victim's request (typically via phishing link, MITM, or crafted HTTP request), (3) the victim must be authenticated to the Koa application (PR:L requirement), and (4) the victim must interact with or follow the redirect (UI:P requirement). Open redirect exploitation is not automatable by typical scanning tools because it depends on user agency to follow the redirect-the server does not force the redirect; it merely suggests one via HTTP Location header. Default Koa configurations do not prevent this vulnerability; it affects any application using the back() function without additional validation logic.

Impact

This vulnerability presents low real-world risk despite public exploit availability. The CVSS v4.0 vector indicates PR:L (requires login), UI:P (requires user interaction), and VI:L (low integrity impact), yielding a CVSS score of 2.0-classified as low severity. The EPSS score of 0.08% (24th percentile) is notably low, suggesting minimal automated exploitation likelihood in the wild. The attack chain requires: (1) attacker to manipulate a Referrer header, (2) an authenticated user of the application to trigger the back() function, and (3) the user to confirm or interact with the redirect. This is fundamentally a client-side social engineering vector-the server issues the redirect but the victim must follow it. The public POC availability does not elevate real risk given the authentication and user interaction requirements. Organizations should prioritize patching high-CVSS, automatable vulnerabilities ahead of this one. However, applications relying on Koa's back() function as part of sensitive workflows (e.g., post-logout redirects, password reset flows) may warrant faster remediation to prevent phishing-like attacks.

Exploit ScenarioDerived

An attacker crafts a phishing email containing a link to a legitimate Koa application with an embedded Referrer header pointing to a malicious site (e.g., via a proxy or request manipulation tool). When an authenticated user clicks the link and the application's back() function is triggered (e.g., a 'return to previous page' button after logout), the user is transparently redirected to the attacker's phishing domain, which mimics the legitimate application to harvest credentials. Publicly available POC code demonstrates this technique by showing how to inject malicious Referrer headers and observe the resulting redirect.

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.9).
Patch available 0.1% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Apr 29, 2026

Open redirect vulnerability in KoaJS Koa up to version 3.0.0 allows authenticated remote attackers to manipulate the Referrer HTTP header via the back() function in lib/response.js, enabling redirect to arbitrary external URLs with user interaction. The vulnerability has publicly available exploit code and affects the HTTP Header Handler component; EPSS exploitation probability is very low at 0.08% despite public POC availability, suggesting this is primarily a client-side social engineering vector rather than a widely exploitable server-side flaw.

RemediationAI

Upgrade KoaJS Koa to a patched version released after 3.0.0. The upstream fix is available at https://github.com/koajs/koa/issues/1892, where the Koa maintainers have addressed this vulnerability by implementing validation of the Referrer header in the back() function to reject redirect targets pointing to external domains. If immediate patching is not possible, implement a compensating control by disabling or wrapping the back() function to validate that redirect destinations are same-origin only (e.g., ensuring the target URL hostname matches the request hostname), or by replacing the use of back() with explicit, hardcoded redirect destinations that cannot be influenced by user-supplied headers. Note that disabling back() entirely may require refactoring client-side 'go back' functionality to use browser history APIs instead.

Affected Packages

npm koa fix: 2.16.2, 3.0.1

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

KoaJS Koa is a lightweight Node.js web framework that provides request/response middleware abstractions. The vulnerability resides in the response.js module's back() function, which is intended to redirect users to their previous page via the HTTP Referer header (note: Koa implements the common misspelling 'Referrer'). CWE-601 (URL Redirection to Untrusted Site / Open Redirect) occurs when user-controlled input-in this case, a maliciously crafted Referrer header-is used to construct a redirect target without validation. The back() function directly uses the Referrer header value without sanitizing it against malicious or external URLs, allowing an attacker to inject arbitrary redirect destinations. This is a classic open redirect vulnerability pattern where the application is manipulated into directing users away from the legitimate domain.

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 2.0 LOW
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:P

Primary rating from NVD · only source for this CVE.

CVSS VectorNVD

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
Low
User Interaction
Passive
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
Low
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

DescriptionCVE.org

A vulnerability, which was classified as problematic, was found in KoaJS Koa up to 3.0.0. Affected is the function back in the library lib/response.js of the component HTTP Header Handler. The manipulation of the argument Referrer leads to open redirect. It is possible to launch the attack remotely. The exploit has been disclosed to the public and may be used.

Threat Intelligence Overview

EPSS Score
0.1%
Top 76% exploitable
Exploit
POC
Public exploit code exists
Data Quality
5 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 LOW
CISA KEV No
Public POC Yes
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
LOW severity (CVSS 0.1-3.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
Low

Priority Score

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

Affected Products (CPE)CVE.org

cpe:2.3:a:koajs:koa:*:*:*:*:*:node.js:*:*
cpe:2.3:a:koajs:koa:3.0.0:-:*:*:*:node.js:*:*
cpe:2.3:a:koajs:koa:3.0.0:alpha0:*:*:*:node.js:*:*
cpe:2.3:a:koajs:koa:3.0.0:alpha1:*:*:*:node.js:*:*
cpe:2.3:a:koajs:koa:3.0.0:alpha2:*:*:*:node.js:*:*
cpe:2.3:a:koajs:koa:3.0.0:alpha3:*:*:*:node.js:*:*
cpe:2.3:a:koajs:koa:3.0.0:alpha4:*:*:*:node.js:*:*
cpe:2.3:a:koajs:koa:3.0.0:alpha5:*:*:*:node.js:*:*

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