Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2022-29167: CWE-400: Uncontrolled Resource Consumption in mozilla hawk

0
Medium
Published: Thu May 05 2022 (05/05/2022, 22:55:10 UTC)
Source: CVE
Vendor/Project: mozilla
Product: hawk

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()`.

AI-Powered Analysis

AILast updated: 06/23/2025, 08:51:18 UTC

Technical Analysis

CVE-2022-29167 is a vulnerability classified under CWE-400 (Uncontrolled Resource Consumption) affecting the Mozilla Hawk HTTP authentication scheme prior to version 9.0.1. Hawk is designed to provide authenticated HTTP requests with partial cryptographic verification, including validation of the HTTP method, request URI, host, and optionally the request payload. The vulnerability arises from the way Hawk parses the 'Host' HTTP header using a regular expression in the function `Hawk.utils.parseHost()`. This regular expression is susceptible to a Regular Expression Denial of Service (ReDoS) attack, where an attacker can craft a maliciously long or complex 'Host' header input that causes the regular expression engine to consume exponentially increasing CPU resources as input length grows. This results in significant performance degradation or service unavailability due to resource exhaustion. The vulnerability was addressed in version 9.0.1 by replacing the vulnerable regular expression parsing with the use of the built-in JavaScript `URL` class, which is more efficient and not vulnerable to ReDoS. Additionally, the `Hawk.authenticate()` function accepts an `options` argument that, if containing `host` and `port`, bypasses the vulnerable `parseHost()` call, mitigating the risk if used properly. No known exploits have been reported in the wild, and no CVSS score is assigned. The vulnerability primarily impacts systems using versions of the Hawk library older than 9.0.1 that process untrusted HTTP requests with the vulnerable parsing method.

Potential Impact

For European organizations, the primary impact of this vulnerability is the potential for Denial of Service (DoS) attacks against services relying on the vulnerable Hawk library for HTTP authentication. An attacker could send specially crafted HTTP requests with malicious 'Host' headers to exhaust CPU resources on affected servers, leading to degraded performance or complete service outages. This can disrupt business operations, especially for web services, APIs, or microservices using Hawk for authentication. Confidentiality and integrity are not directly impacted by this vulnerability, as it does not allow unauthorized access or data manipulation. However, availability is significantly affected, which can indirectly impact business continuity and customer trust. Organizations in sectors with high reliance on web-based services, such as finance, telecommunications, and government services, may experience operational disruptions. The absence of known exploits reduces immediate risk, but the ease of triggering ReDoS attacks with crafted inputs means the threat remains relevant. The vulnerability's impact is limited to systems using vulnerable Hawk versions and processing untrusted HTTP requests, so organizations using updated versions or alternative authentication schemes are not affected.

Mitigation Recommendations

To mitigate this vulnerability, European organizations should: 1) Immediately upgrade all instances of the Hawk library to version 9.0.1 or later, where the vulnerable regular expression parsing has been replaced with the secure `URL` class. 2) Review and audit all applications and services that use Hawk for HTTP authentication to ensure they do not rely on vulnerable versions. 3) If upgrading is not immediately feasible, implement input validation and filtering at the network or application layer to detect and block suspiciously long or malformed 'Host' headers that could trigger ReDoS. 4) Utilize web application firewalls (WAFs) with custom rules to detect and mitigate ReDoS attack patterns targeting the 'Host' header. 5) Monitor application performance metrics and logs for signs of resource exhaustion or unusual request patterns indicative of ReDoS attempts. 6) Educate developers and security teams about the risks of ReDoS vulnerabilities and the importance of using safe parsing methods for user-controlled inputs. 7) Where possible, configure `Hawk.authenticate()` calls to use the `options` argument with explicit `host` and `port` values to bypass vulnerable parsing logic.

Need more detailed analysis?Upgrade to Pro Console

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2022-04-13T00:00:00.000Z
Cisa Enriched
true

Threat ID: 682d9843c4522896dcbf2f14

Added to database: 5/21/2025, 9:09:23 AM

Last enriched: 6/23/2025, 8:51:18 AM

Last updated: 2/3/2026, 12:42:44 PM

Views: 41

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats