Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. hawk
  4. ›
  5. CVE-2022-29167

CVE-2022-29167: Regular Expression Denial of Service

May 5, 2022 (updated July 21, 2023)

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

References

  • github.com/mozilla/hawk/pull/286
  • github.com/mozilla/hawk/security/advisories/GHSA-44pw-h2cw-w3vq
  • nvd.nist.gov/vuln/detail/CVE-2022-29167
  • www.owasp.org/index.php/Regular_expression_Denial_of_Service_-_ReDoS

Code Behaviors & Features

Detect and mitigate CVE-2022-29167 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 9.0.1

Fixed versions

  • 9.0.1

Solution

Upgrade to version 9.0.1 or above.

Impact 7.5 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Learn more about CVSS

Weakness

  • CWE-1333: Inefficient Regular Expression Complexity

Source file

npm/hawk/CVE-2022-29167.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:14:27 +0000.