Koa has Inefficient Regular Expression Complexity
koajs koa
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| koa npm |
|
|
koajs koa
| Product | Affected | Fixed in |
|---|---|---|
| koa npm |
|
|
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.
From the CVE record · GitHub_M
Koa uses a vulnerable regular expression to parse the X-Forwarded-Proto and X-Forwarded-Host HTTP headers. An attacker can exploit it through HTTP requests to cause a denial of service. Authentication and user-interaction requirements are not specified.
Teams running the npm koa package should check versions below 0.21.2, 1.0.0 through 1.7.0, 2.0.0 through 2.15.3, and 3.0.0-alpha.0 through 3.0.0-alpha.2.