Vulnerabilities in pkg:npm/hoek
PACKAGECVE-2018-3728 is a HIGH (CVSS 8.8) prototype pollution vulnerability (CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')) affecting Hoek libraries in the npm ecosystem. The issue involves prototype pollution in hoek. Remediation is available by upgrading affected packages to version 5.0.3, 4.2.1.
pkg:npm/hoek
Vulnerability advisories affecting package pkg:npm/hoek. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-jp4x-w63m-7wgm | CVE-2018-3728 | HIGH | Prototype Pollution in hoek |
| GHSA-c429-5p7v-vgjp | CVE-2020-36604 | HIGH | hoek subject to prototype pollution via the clone function. |
CVE-2018-3728 at a Glance
Security Impact
CVSS: 8.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2018-3728
To remediate this vulnerability, upgrade all affected 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 hoek@5.0.3
npm install hoek@4.2.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls hoek
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2018-3728, inspect your project dependencies using npm:
npm ls hoek
Analyze the terminal output to locate any version of Hoek in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.0.3), your application is affected.
Note: The npm ls 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 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
CVE-2018-3728 Affected Hoek Versions
2 component(s)References
Frequently Asked Questions
What is CVE-2018-3728?
Which Hoek versions are affected?
What version fixes CVE-2018-3728?
Is hoek affected?
What is the CVSS score of CVE-2018-3728?
What CWE is associated with CVE-2018-3728?
How can I check npm dependencies for CVE-2018-3728?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-jp4x-w63m-7wgm",
"modified" : "2025-05-29T22:49:49Z",
"published" : "2018-04-26T15:25:17Z",
"aliases" : [ "CVE-2018-3728" ],
"summary" : "Prototype Pollution in hoek",
"details" : "Versions of `hoek` prior to 4.2.1 and 5.0.3 are vulnerable to prototype pollution.\n\nThe `merge` function, and the `applyToDefaults` and `applyToDefaultsWithShallow` functions which leverage `merge` behind the scenes, are vulnerable to a prototype pollution attack when provided an _unvalidated_ payload created from a JSON string containing the `__proto__` property.\n\nThis can be demonstrated like so:\n\n```javascript\nvar Hoek = require('hoek');\nvar malicious_payload = '{\"__proto__\":{\"oops\":\"It works !\"}}';\n\nvar a = {};\nconsole.log(\"Before : \" + a.oops);\nHoek.merge({}, JSON.parse(malicious_payload));\nconsole.log(\"After : \" + a.oops);\n```\n\nThis type of attack can be used to overwrite existing properties causing a potential denial of service.\n\n\n## Recommendation\n\nUpdate to version 4.2.1, 5.0.3 or later.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "hoek"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.0.0"
}, {
"fixed" : "5.0.3"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "hoek"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.2.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-3728"
}, {
"type" : "WEB",
"url" : "https://github.com/hapijs/hoek/commit/32ed5c9413321fbc37da5ca81a7cbab693786dee"
}, {
"type" : "WEB",
"url" : "https://github.com/hapijs/hoek/commit/5aed1a8c4a3d55722d1c799f2368857bf418d6df"
}, {
"type" : "WEB",
"url" : "https://hackerone.com/reports/310439"
}, {
"type" : "WEB",
"url" : "https://access.redhat.com/errata/RHSA-2018:1263"
}, {
"type" : "WEB",
"url" : "https://access.redhat.com/errata/RHSA-2018:1264"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/hapijs/hoek"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/npm:hoek:20180212"
}, {
"type" : "WEB",
"url" : "https://web.archive.org/web/20200227131737/https://www.securityfocus.com/bid/103108"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1321" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2020-06-16T21:43:55Z",
"nvd_published_at" : null
}
}