CVE-2022-29167 ReDoS vulnerability in header parsing in hawk
An attacker can cause a denial of service in the Hawk library by sending a malicious Host header that triggers exponential regex backtracking.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2022-29167?
CVE-2022-29167 is a high-severity denial of service vulnerability in mozilla hawk, published on 5 May 2022. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
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()`.
Which versions are affected by CVE-2022-29167?
2 open source packages ship an affected version, including hawk. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
hawk npm | All versions | 9.0.1 |
hawk npm | All versions | 9.0.1 |
Products include Mozilla Hawk.
How do I fix CVE-2022-29167?
Upgrade hawk to 9.0.1 or later.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2022-29167 being exploited?
There is no known exploitation of CVE-2022-29167 in the wild and no public exploit code.
Sources
Also known as CLSA-2026-1776818225, DEBIAN-CVE-2022-29167, DLA-3246-1, GHSA-44pw-h2cw-w3vq, MGASA-2024-0086, OESA-2022-1667 and 2 more.