GHSA-22h7-7wwg-qmgg: @hapi/hoek Prototype Pollution Vulnerability
LOWGHSA-22h7-7wwg-qmgg is a LOW prototype pollution vulnerability (CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')) affecting @hapi/hoek libraries in the npm ecosystem. The issue involves prototype pollution in @hapi/hoek. Remediation is available by upgrading affected packages to version 8.5.1, 9.0.3.
GHSA-22h7-7wwg-qmgg at a Glance
How to Fix GHSA-22h7-7wwg-qmgg
To remediate this vulnerability, upgrade all affected @hapi/hoek 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 @hapi/hoek@8.5.1
npm install @hapi/hoek@9.0.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @hapi/hoek
How to Check if You Are Affected
To determine whether your Node.js application is affected by GHSA-22h7-7wwg-qmgg, inspect your project dependencies using npm:
npm ls @hapi/hoek
Analyze the terminal output to locate any version of @hapi/hoek in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 8.5.1), your application is affected.
Note: The npm ls @hapi/hoek 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-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution'), where the product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype. In @hapi/hoek, 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
GHSA-22h7-7wwg-qmgg Affected @hapi/hoek Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@hapi/hoek
|
npm |
≥ 8.3.2
< 8.5.1
|
8.5.1
|
|
@hapi/hoek
|
npm |
≥ 9.0.0
< 9.0.3
|
9.0.3
|
References
Frequently Asked Questions
What is GHSA-22h7-7wwg-qmgg?
Which @hapi/hoek versions are affected?
What version fixes GHSA-22h7-7wwg-qmgg?
Is @hapi/hoek affected?
What CWE is associated with GHSA-22h7-7wwg-qmgg?
How can I check npm dependencies for GHSA-22h7-7wwg-qmgg?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-22h7-7wwg-qmgg",
"modified" : "2020-08-31T19:00:24Z",
"published" : "2020-09-04T17:56:39Z",
"aliases" : [ ],
"summary" : "Prototype Pollution in @hapi/hoek",
"details" : "Versions of `@hapi/hoek` prior to 8.5.1 and 9.0.3 are vulnerable to Prototype Pollution. The `clone` function fails to prevent the modification of the Object prototype when passed specially-crafted input. Attackers may use this to change existing properties that exist in all objects, which may lead to Denial of Service or Remote Code Execution in specific circumstances. \nThis issue __does not__ affect hapi applications since the framework protects against such malicious inputs. Applications that use `@hapi/hoek` outside of the hapi ecosystem may be vulnerable.\n\n\n## Recommendation\n\nUpdate to version 8.5.1, 9.0.3 or later.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@hapi/hoek"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "8.3.2"
}, {
"fixed" : "8.5.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "@hapi/hoek"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "9.0.0"
}, {
"fixed" : "9.0.3"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://www.npmjs.com/advisories/1468"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1321" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2020-08-31T19:00:24Z",
"nvd_published_at" : null
}
}