CVE-2022-29167: Uncontrolled Resource Consumption in Hawk
Summary
CVE-2022-29167: Uncontrolled Resource Consumption in Hawk. Affects hawk versions < 9.0.1. Fixed in 9.0.1. How to fix ↓
Also tracked for
- node-hawk · Debian:11
The same CVE-2022-29167 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Hawk is an HTTP authentication scheme that provides mechanisms for making authenticated HTTP requests with partial cryptographic verification. It covers the HTTP method, request URI, host, and optionally the request payload. The vulnerability in Hawk arises from the regular expression used to parse the Host HTTP header. This regular expression is susceptible to a regular expression Denial of Service (DoS) attack, where each added character in the attacker's input exponentially increases the computation time. The vulnerable function, Hawk.utils.parseHost(), was patched in version 9.0.1 to use the built-in URL class for hostname parsing. The vulnerability can be exploited by an attacker to cause uncontrolled resource consumption and potentially impact the availability of the affected system.
Vulnerability Detail
The vulnerability in Hawk allows an attacker to perform a regular expression DoS attack by manipulating the Host HTTP header. By crafting a malicious input, the attacker can cause the computation time to increase exponentially, leading to uncontrolled resource consumption. This can result in a denial of service condition, impacting the availability of the system. The vulnerability affects versions prior to 9.0.1 of the Hawk package.
How To Fix
Latest published version: 9.0.2 as of 22 Oct 2026
npm install hawk@9.0.2
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
9.0.1
This is the first release that contains the fix.
npm install hawk@9.0.1
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If updating the package is not immediately feasible, a temporary workaround is to avoid using the Hawk.utils.parseHost() function and instead provide the host and port directly in the options argument of the Hawk.authenticate() function. By bypassing the vulnerable function, the risk of a regular expression DoS attack can be mitigated.
Conclusion
The vulnerability in the Hawk package allows an attacker to perform a regular expression DoS attack, leading to uncontrolled resource consumption and potentially causing a denial of service condition. It is crucial to update the package to version 9.0.1 or later to mitigate the risk. Alternatively, the vulnerable function can be bypassed by providing the host and port directly in the options argument. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for hawk →
FAQ
The vulnerability allows an attacker to perform a regular expression DoS attack, leading to uncontrolled resource consumption and potentially causing a denial of service condition.
Versions prior to 9.0.1 of the Hawk package are affected by this vulnerability.
Yes, the vulnerability has been patched in version 9.0.1 of the Hawk package.
A regular expression DoS attack is a type of denial of service attack where an attacker crafts a malicious input that causes the computation time of a regular expression to increase exponentially, leading to uncontrolled resource consumption.
To mitigate the risk, it is recommended to update the Hawk package to version 9.0.1 or later. Alternatively, you can avoid using the vulnerable Hawk.utils.parseHost() function and provide the host and port directly in the options argument of the Hawk.authenticate() function.
References
Related vulnerabilities
Recent vulnerabilities recorded for hawk.