CVE-2025-8129: Koa Open Redirect Vulnerability in KoaJS
Summary
CVE-2025-8129: Duplicate Advisory: Koa Open Redirect via Referrer Header (User-Controlled). Affects koa versions < 3.0.1. Fixed in 3.0.1. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
KoaJS is a popular web framework for Node.js designed to build web applications and APIs. It is known for its lightweight and modular architecture, allowing developers to create robust applications with minimal overhead. However, versions up to 3.0.0 have been found to contain a vulnerability that can lead to open redirects, potentially compromising the security of applications built with this framework.
Vulnerability Detail
The vulnerability arises from the manipulation of the 'Referrer' argument in the 'back' function located in the 'lib/response.js' file of the Koa library. This flaw allows attackers to redirect users to malicious sites, which can lead to phishing attacks or other malicious activities. The issue is classified as problematic and can be exploited remotely, posing a significant risk to applications that utilize KoaJS.
How To Fix
Latest published version: 3.2.1 as of 22 Oct 2026
npm install koa@3.2.1
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
3.0.1
This is the first release that contains the fix.
npm install koa@3.0.1
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If immediate upgrading is not feasible, consider implementing input validation on the 'Referrer' argument to restrict it to known safe URLs. This can help mitigate the risk of open redirects until the package can be updated.
Conclusion
The Koa Open Redirect Vulnerability (CVE-2025-8129) poses a significant risk to applications built with KoaJS versions up to 3.0.0. It is crucial to update to version 3.0.1 or later to mitigate this risk. Additionally, using tools like Vulert can help monitor and alert for such vulnerabilities in real-time.
See every vulnerability recorded for koa →
FAQ
An open redirect vulnerability allows attackers to redirect users to arbitrary URLs, which can be exploited for phishing or other malicious purposes.
You can check if your application is affected by using Vulert, which monitors and alerts for open-source vulnerabilities in your software. Visit Vulert Scanner to test your application without needing to sign up.
Koa versions up to 3.0.0 are affected by this vulnerability. It is recommended to upgrade to version 3.0.1 or later.
Exploitation of this vulnerability can lead to users being redirected to malicious sites, resulting in data theft, phishing attacks, or other security breaches.
Yes, implementing input validation on the 'Referrer' argument can help mitigate the risk of open redirects until you can upgrade the package.
References
Related vulnerabilities
Recent vulnerabilities recorded for koa.