CVE-2025-25200 Koa has Inefficient Regular Expression Complexity

Critical 9.2 Published Updated

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.

PackageAffectedFixed in
koa npmAll versions0.21.2
koa npmAll versions0.21.2
koa npmFrom 1.0.01.7.1
koa npmFrom 1.0.01.7.1
koa npmFrom 2.0.02.15.4
koa npmFrom 2.0.02.15.4
2 more packages
koa npmFrom 3.0.0-alpha.03.0.0-alpha.3
koa npmFrom 3.0.0-alpha.03.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.

Sources

Also known as GHSA-593f-38f6-jp5m, ROOT-APP-NPM-CVE-2025-25200.

Is CVE-2025-25200 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free