Vulnerability · Published May 5, 2022 · Assigned by GitHub_M
CVE-2022-29167ReDoS vulnerability in header parsing in hawk
High 7.4
In plain English
A high-severity uncontrolled resource consumption in hawk from mozilla. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 1.1% (higher than 66% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
Hawk is an HTTP authentication scheme providing mechanisms for making authenticated HTTP requests with partial cryptographic verification of the request and response, covering the HTTP method, request URI, host, and optionally the request payload. Hawk used a regular expression to parse `Host` HTTP header (`Hawk.utils.parseHost()`), which was subject to regular expression DoS attack - meaning each added character in the attacker's input increases the computation time exponentially. `parseHost()` was patched in `9.0.1` to use built-in `URL` class to parse hostname instead. `Hawk.authenticate()` accepts `options` argument. If that contains `host` and `port`, those would be used instead of a call to `utils.parseHost()`.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | node-hawk | 9.0.1-1 | DEBIAN-CVE-2022-29167 |
| Debian:13 | node-hawk | 9.0.1-1 | DEBIAN-CVE-2022-29167 |
| Debian:14 | node-hawk | 9.0.1-1 | DEBIAN-CVE-2022-29167 |
| Ubuntu:22.04:LTS | node-hawk | 8.0.1+dfsg-1ubuntu0.22.04.1 | USN-6116-1 |
| Ubuntu:22.04:LTS | node-hawk | 8.0.1+dfsg-1ubuntu0.22.04.1 | UBUNTU-CVE-2022-29167 |
| npm | hawk | 9.0.1 | GHSA-44pw-h2cw-w3vq |
Affected products (as reported)
Weakness: CWE-400 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:N/A:H
References
- https://github.com/mozilla/hawk/security/advisories/GHSA-44pw-h2cw-w3vq x_refsource_CONFIRM
- https://github.com/mozilla/hawk/pull/286 x_refsource_MISC