CVE-2025-25200 Koa has Inefficient Regular Expression Complexity
Attackers can cause denial of service in Koa applications by sending malicious HTTP headers that trigger inefficient regular expression processing.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2025-25200?
CVE-2025-25200 is a critical denial of service vulnerability in koajs koa, published on 12 Feb 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
Koa is expressive middleware for Node.js using ES2017 async functions. Prior to versions 0.21.2, 1.7.1, 2.15.4, and 3.0.0-alpha.3, Koa uses an evil regex to parse the `X-Forwarded-Proto` and `X-Forwarded-Host` HTTP headers. This can be exploited to carry out a Denial-of-Service attack. Versions 0.21.2, 1.7.1, 2.15.4, and 3.0.0-alpha.3 fix the issue.
Weakness: CWE-1333
Which versions are affected by CVE-2025-25200?
8 open source packages ship an affected version, including koa. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
koa npm | All versions | 0.21.2 |
koa npm | All versions | 0.21.2 |
koa npm | From 1.0.0 | 1.7.1 |
koa npm | From 1.0.0 | 1.7.1 |
koa npm | From 2.0.0 | 2.15.4 |
koa npm | From 2.0.0 | 2.15.4 |
2 more packages
koa npm | From 3.0.0-alpha.0 | 3.0.0-alpha.3 |
koa npm | From 3.0.0-alpha.0 | 3.0.0-alpha.3 |
Products include Koajs Koa.
How do I fix CVE-2025-25200?
Upgrade koa to a fixed version for your release line: 0.21.2, 1.7.1, 2.15.4 or 3.0.0-alpha.3.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2025-25200 being exploited?
There is no known exploitation of CVE-2025-25200 in the wild and no public exploit code.
Public exploit code: 2 proofs of concept on GitHub.
Other vulnerabilities in koajs koa
Sources
Also known as GHSA-593f-38f6-jp5m, ROOT-APP-NPM-CVE-2025-25200.