GitHub Advisoryadvisory · npm

GHSA-593f-38f6-jp5m Inefficient Regular Expression Complexity in koa

CRITICAL Published 2025-02-12 Modified 2025-02-12 Official page ↗
Aliases
CVE-2025-25200
Ecosystem
npm
Packages
koa
Severity
Critical
CVSS 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
Weaknesses
CWE-1333
Reviewed
2025-02-12

Affected packages

• npm koa: >= 2.0.0, < 2.15.4 → fixed in 2.15.4 • npm koa: >= 3.0.0-alpha.0, < 3.0.0-alpha.3 → fixed in 3.0.0-alpha.3 • npm koa: >= 1.0.0, < 1.7.1 → fixed in 1.7.1 • npm koa: < 0.21.2 → fixed in 0.21.2

Description

Summary 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. PoC Coming soon. Impact This is a Regex Denial-of-Service attack and causes memory exhaustion. The regex should be improved and empty values should not be allowed.

Related

Alias · CVE (1)

  • CVE-2025-25200 Koa is expressive middleware for Node.js using ES2017 async functions. vulnerability

Weakness · CWE (1)

  • CWE-1333 Inefficient Regular Expression Complexity weakness

References