CVE-2018-3728: High severity @hapi/hoek vulnerability

Published Feb 15, 2018
·
Updated

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

5 affected componentsFixes available
redhat/hoek<5.0.3
5.0.3
Hapijs Hoek Node.js<4.2.0
Hapijs Hoek Node.js>=5.0.0<5.0.3
npm/hoek<4.2.1
4.2.1
npm/hoek>=5.0.0<5.0.3
5.0.3

Event History

Mar 30, 2018
CVE Published
via MITRE·07:00 PM
Data Sourced
via MITRE·07:00 PM
DescriptionWeakness
Apr 26, 2018
Advisory Published
03:25 PM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

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.

2

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.

3

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.

4

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.

5

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.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203