CVE Vulnerabilities

CVE-2025-25200

Inefficient Regular Expression Complexity

Published: Feb 12, 2025 | Modified: Jan 20, 2026
CVSS 3.x
7.5
HIGH
Source:
NVD
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
CVSS 2.x
RedHat/V2
RedHat/V3
Ubuntu
root.io logo minimus.io logo echo.ai logo

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

The product uses a regular expression with an inefficient, possibly exponential worst-case computational complexity that consumes excessive CPU cycles.

Affected Software

NameVendorStart VersionEnd Version
KoaKoajs*0.21.2 (excluding)
KoaKoajs1.0.0 (including)1.7.1 (excluding)
KoaKoajs2.0.0 (including)2.15.4 (excluding)
KoaKoajs3.0.0-alpha0 (including)3.0.0-alpha0 (including)
KoaKoajs3.0.0-alpha1 (including)3.0.0-alpha1 (including)
KoaKoajs3.0.0-alpha2 (including)3.0.0-alpha2 (including)

Extended Description

	  Attackers can create crafted inputs that
	  intentionally cause the regular expression to use
	  excessive backtracking in a way that causes the CPU
	  consumption to spike.

Potential Mitigations

References