CVE-2018-3728: High severity @hapi/hoek vulnerability
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 leading to potential denial of service.
References:
https://snyk.io/vuln/npm:hoek:20180212 https://hackerone.com/reports/310439
Other sources
hoek node module before 4.2.0 and 5.0.x before 5.0.3 suffers from a Modification of Assumed-Immutable Data (MAID) vulnerability via 'merge' and 'applyToDefaults' functions, which allows a malicious user to modify the prototype of "Object" via proto, causing the addition or modification of an existing property that will exist on all objects.
— MITRE
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:
javascript var Hoek = require('hoek'); var maliciouspayload = '{"proto":{"oops":"It works !"}}';
var a = {}; console.log("Before : " + a.oops); Hoek.merge({}, JSON.parse(maliciouspayload)); console.log("After : " + a.oops);
This type of attack can be used to overwrite existing properties causing a potential denial of service.
Recommendation
Update to version 4.2.1, 5.0.3 or later.
— GitHub
Affected Software
Remediation
Patch Available
Event History
Frequently Asked Questions
What is the severity of CVE-2018-3728?
CVE-2018-3728 is classified as a medium severity vulnerability due to its potential for denial of service.
How do I fix CVE-2018-3728?
To fix CVE-2018-3728, you should update the 'hoek' package to version 5.0.3 or higher.
Which versions of 'hoek' are affected by CVE-2018-3728?
CVE-2018-3728 affects 'hoek' versions prior to 5.0.3, including all versions from 4.0.0 to 4.2.1.
Can CVE-2018-3728 lead to data breaches?
CVE-2018-3728 primarily allows for denial of service and does not directly lead to data breaches, but injection weaknesses may pose risks.
Is the 'hoek' package widely used in applications susceptible to CVE-2018-3728?
Yes, the 'hoek' package is commonly used in the Node.js ecosystem, making applications that depend on it susceptible to CVE-2018-3728.