Inefficient Regular Expression Complexity in koa
Affected releases · koa
- 2.x2.0.0 – 2.15.3Fixed in 2.15.4
- 1.x1.0.0 – 1.7.0Fixed in 1.7.1
- 0.21.x0.21.0 – 0.21.1Fixed in 0.21.2
- 0.20.x and older0.0.1 – 0.20.0No fix, no longer updated
On 2.x, the newest line:
npm install koa@2.15.4Every release on a timeline
Not affected
3.0.0 – 3.3.0
10 releases, latest
Affected
2.0.0 – 2.15.3
35 releases
Fixed
2.15.4 – 2.16.4
6 releases
Affected
1.0.0 – 1.7.0
19 releases
Fixed
1.7.1
1 release
Affected
0.0.1 – 0.21.1
41 releases
Fixed
0.21.2
1 release
What happens
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.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.