CVE-2022-29167: Uncontrolled Resource Consumption in Hawk

hawk Updated 02 Oct 2025

Summary

23/05/2022
Yes i
High
7.4

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

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.

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

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 →

Share this vulnerability

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.

Related vulnerabilities

Recent vulnerabilities recorded for hawk.

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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback