KoaJS Koa
CVE-2025-8129
LOW
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconAttacker injects malicious Referrer header
-
DeliveryVictim clicks crafted link to legitimate app
-
ExploitVictim triggers back() function
-
InstallKoa reads unvalidated Referrer
-
C2Responds with redirect to attacker domain
-
ExecuteBrowser follows Location header
-
ImpactUser 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. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
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
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
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
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)CVE.org
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
An open redirect in Koa's ctx.back() helper lets remote, unauthenticated attackers force a victim's browser to an attack
Koa is expressive middleware for Node.js using ES2017 async functions. Rated critical severity (CVSS 9.2), this vulnerab
Koa is expressive middleware for Node.js using ES2017 async functions. Rated medium severity (CVSS 5.0), this vulnerabil
NVD
CVE.org
EPSS
GitHub
VulDB
Exploit-DB