Inefficient Regular Expression Complexity in koa
Package
Affected versions
>= 2.0.0, < 2.15.4
>= 3.0.0-alpha.0, < 3.0.0-alpha.3
>= 1.0.0, < 1.7.1
< 0.21.2
Patched versions
2.15.4
3.0.0-alpha.3
1.7.1
0.21.2
Description
Published by the National Vulnerability Database
Feb 12, 2025
Published to the GitHub Advisory Database
Feb 12, 2025
Reviewed
Feb 12, 2025
Last updated
Feb 12, 2025
Summary
Koa uses an evil regex to parse the
X-Forwarded-Proto
andX-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.
References