CVE-2022-29167: Hawk Remote Code Execution Vulnerability
HIGHCVE-2022-29167 is a HIGH (CVSS 7.4) remote code execution vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Hawk libraries in the npm ecosystem. The issue involves uncontrolled resource consumption in hawk. Remediation is available by upgrading affected packages to version 9.0.1.
CVE-2022-29167 at a Glance
Security Impact
CVSS: 7.4
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:N/A:H).
How to Fix CVE-2022-29167
To remediate this vulnerability, upgrade all affected Hawk dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install hawk@9.0.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls hawk
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2022-29167, inspect your project dependencies using npm:
npm ls hawk
Analyze the terminal output to locate any version of Hawk in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 9.0.1), your application is affected.
Note: The npm ls hawk command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Hawk, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-29167 Affected Hawk Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
hawk
|
npm |
< 9.0.1
|
9.0.1
|
References
Frequently Asked Questions
What is CVE-2022-29167?
Which Hawk versions are affected?
What version fixes CVE-2022-29167?
Is hawk affected?
What is the CVSS score of CVE-2022-29167?
What CWE is associated with CVE-2022-29167?
How can I check npm dependencies for CVE-2022-29167?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-44pw-h2cw-w3vq",
"modified" : "2022-05-23T20:18:14Z",
"published" : "2022-05-23T20:18:14Z",
"aliases" : [ "CVE-2022-29167" ],
"summary" : "Uncontrolled Resource Consumption in Hawk",
"details" : "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()`.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "hawk"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "9.0.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/mozilla/hawk/security/advisories/GHSA-44pw-h2cw-w3vq"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-29167"
}, {
"type" : "WEB",
"url" : "https://github.com/mozilla/hawk/pull/286"
}, {
"type" : "WEB",
"url" : "https://github.com/mozilla/hawk/commit/d10d72ca82db967f6c5fcf866ff78e3ca25ce1ab"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/mozilla/hawk"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1333", "CWE-400" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-05-23T20:18:14Z",
"nvd_published_at" : "2022-05-05T23:15:00Z"
}
}