Vulnerability · Published Feb 12, 2025 · Assigned by GitHub_M

CVE-2025-25200Koa has Inefficient Regular Expression Complexity

Critical 9.2

In plain English

A critical-severity regular-expression denial of service in koa from koajs. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.8% (higher than 58% of all known vulnerabilities). Ready-made attack tooling exists: public proof-of-concept code. Fixed versions are available - upgrade the affected package.

Severity (CVSS 4.0)9.2Critical
Exploit odds (30 days)0.8%top 41.9% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack tooling1Public PoC

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.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
npmkoa2.15.4GHSA-593f-38f6-jp5m
npmkoa3.0.0-alpha.3GHSA-593f-38f6-jp5m
npmkoa1.7.1GHSA-593f-38f6-jp5m
npmkoa0.21.2GHSA-593f-38f6-jp5m

Affected products (as reported)

VendorProductVersions
koajs koa < 0.21.2>= 1.0.0, < 1.7.1>= 2.0.0-alpha.1, < 2.15.4>= 3.0.0-alpha.0, < < 3.0.0-alpha.3

Weakness: CWE-1333 · Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:H

References