{"id":"CVE-2018-3728","aliases":["GHSA-jp4x-w63m-7wgm"],"url":"https://o3.security/vulnerability/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.","published":"2018-03-30T19:29:00.210Z","modified":"2026-10-20T10:50:27.724856249Z","cvss":{"score":8.8,"severity":"HIGH","vector":"CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"},"epss":null,"cisaKev":null,"exploitsKnown":2,"affectedPackages":[{"ecosystem":"npm","name":"hoek","fixedVersion":"5.0.3"},{"ecosystem":"npm","name":"hoek","fixedVersion":"4.2.1"}],"fix":{"url":"https://github.com/hapijs/hoek/commit/32ed5c9413321fbc37da5ca81a7cbab693786dee","label":"hapijs/hoek@32ed5c9"},"references":[{"type":"ADVISORY","url":"http://www.securityfocus.com/bid/103108"},{"type":"ADVISORY","url":"https://access.redhat.com/errata/RHSA-2018:1263"},{"type":"ADVISORY","url":"https://access.redhat.com/errata/RHSA-2018:1264"},{"type":"ADVISORY","url":"https://nodesecurity.io/advisories/566"},{"type":"FIX","url":"https://github.com/hapijs/hoek/commit/32ed5c9413321fbc37da5ca81a7cbab693786dee"},{"type":"FIX","url":"https://snyk.io/vuln/npm:hoek:20180212"},{"type":"EVIDENCE","url":"https://hackerone.com/reports/310439"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2018-3728"},{"type":"WEB","url":"https://github.com/hapijs/hoek/commit/5aed1a8c4a3d55722d1c799f2368857bf418d6df"},{"type":"PACKAGE","url":"https://github.com/hapijs/hoek"},{"type":"WEB","url":"https://web.archive.org/web/20200227131737/https://www.securityfocus.com/bid/103108"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-10-20T10:50:27.724856249Z"}}