GHSA-22h7-7wwg-qmgg: @hapi/hoek Prototype Pollution Vulnerability

LOW
CWE-1321
Published
Advisory Summary

GHSA-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

CVE Identifier N/A
GHSA Identifier GHSA-22h7-7wwg-qmgg
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
Affected Product @hapi/hoek
Package Ecosystem npm
Published Date
Last Updated

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.

@hapi/hoek fixed: 8.5.1
npm install @hapi/hoek@8.5.1
@hapi/hoek fixed: 9.0.3
npm install @hapi/hoek@9.0.3
Verify Direct and Transitive Dependencies

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

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. This 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. ## Recommendation Update to version 8.5.1, 9.0.3 or later.

GHSA-22h7-7wwg-qmgg Affected @hapi/hoek Versions

2 component(s)
Fixed Versions:
8.5.19.0.3
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?
GHSA-22h7-7wwg-qmgg is a security vulnerability in @hapi/hoek involving Prototype Pollution in @hapi/hoek under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution').
Which @hapi/hoek versions are affected?
Affected versions include releases prior to 8.5.1, 9.0.3 across affected packages: @hapi/hoek.
What version fixes GHSA-22h7-7wwg-qmgg?
Upgrading to 8.5.1, 9.0.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @hapi/hoek affected?
Yes, @hapi/hoek is affected in releases prior to 8.5.1, 9.0.3. Upgrade your dependency to 8.5.1, 9.0.3 or later.
What CWE is associated with GHSA-22h7-7wwg-qmgg?
GHSA-22h7-7wwg-qmgg is classified under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution') (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.).
How can I check npm dependencies for GHSA-22h7-7wwg-qmgg?
Run the dependency tree command: 'npm ls @hapi/hoek'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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
  }
}