ADVISORIES

GitHub Advisory Database

GHSA-593f-38f6-jp5m

Inefficient Regular Expression Complexity in koa

Critical CVE-2025-25200

Details

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.

Affected packages

EcosystemPackageAffected versions
npmkoa
From 2.0.0 before 2.15.4 (fixed in 2.15.4)
npmkoa
From 3.0.0-alpha.0 before 3.0.0-alpha.3 (fixed in 3.0.0-alpha.3)
npmkoa
From 1.0.0 before 1.7.1 (fixed in 1.7.1)
npmkoa
All versions before 0.21.2 (fixed in 0.21.2)

References