# CVE-2025-8129: KoaJS Koa HTTP Header response.js back redirect

> Attackers can exploit an open redirect in the KoaJS framework's HTTP header handler to redirect users to malicious sites.

- **Severity:** Medium 5.1 (`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`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 25 Jul 2025
- **Updated:** 25 Jul 2025
- **Also known as:** CVE-2025-54420, GHSA-jgmv-j7ww-jx2x, ROOT-APP-NPM-CVE-2025-8129

## What is CVE-2025-8129?

CVE-2025-8129 is a medium-severity vulnerability in KoaJS Koa, published on 25 Jul 2025. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

### Official description

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.

Weakness: CWE-601 (URL Redirection to Untrusted Site)

## Which versions are affected by CVE-2025-8129?

4 open source packages ship an affected version, including koa. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `koa` | npm | From 2.0.0 | 2.16.2 |
| `koa` | npm | From 2.0.0 | 2.16.2 |
| `koa` | npm | From 3.0.0-alpha.0 | 3.0.1 |
| `koa` | npm | From 3.0.0-alpha.0 | 3.0.1 |

Products: Koajs Koa.

## How do I fix CVE-2025-8129?

Upgrade koa to a fixed version for your release line: 2.16.2 or 3.0.1.

## Is CVE-2025-8129 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-8129 exists.

## Other vulnerabilities in KoaJS Koa

- [CVE-2025-25200](https://insights.sbomify.com/CVE-2025-25200/): Koa has Inefficient Regular Expression Complexity (critical 9.2)
- [CVE-2026-27959](https://insights.sbomify.com/CVE-2026-27959/): Koa has Host Header Injection via `ctx.hostname` (high 7.5)
- [CVE-2025-32379](https://insights.sbomify.com/CVE-2025-32379/): XSS at ctx.redirect() function in Koajs (medium 5.0)
- [CVE-2025-62595](https://insights.sbomify.com/CVE-2025-62595/): Koa Vulnerable to Open Redirect via Trailing Double-Slash (//) in back Redirect Logic (medium 4.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-8129 and fix it if it is affected.

What it is: CVE-2025-8129 is a medium-severity vulnerability in KoaJS Koa, published on 25 Jul 2025. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-8129 exists.

Affected packages and fixed versions:
- koa (npm): affected from 2.0.0; fixed in 2.16.2
- koa (npm): affected from 2.0.0; fixed in 2.16.2
- koa (npm): affected from 3.0.0-alpha.0; fixed in 3.0.1
- koa (npm): affected from 3.0.0-alpha.0; fixed in 3.0.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-8129/ (Markdown: https://insights.sbomify.com/CVE-2025-8129/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-8129
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-8129
- OSV: https://osv.dev/vulnerability/CVE-2025-8129

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-8129/
Summaries are generated and may contain mistakes; the official description above is the record.
