Advisories for Npm/Hoek package

2022
2018

Prototype Pollution in hoek

Versions of hoek prior to 4.2.1 and 5.0.3 are vulnerable to prototype pollution. The 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. This can be demonstrated like so: var Hoek = require('hoek'); var malicious_payload = '{"proto":{"oops":"It works !"}}'; var a = {}; console.log("Before …