CVE-2018-3728: Prototype Pollution in hoek

hoek Updated 02 Oct 2025

Summary

26/04/2018
Yes i
High
8.8

CVE-2018-3728: Prototype Pollution in hoek. Affects hoek across 2 version ranges.

< 4.2.1 >= 5.0.0, < 5.0.3

Fixed in 4.2.1 or 5.0.3, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2018-3728 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Hoek is an npm package that provides a set of utility functions commonly used in other Node.js modules. It is designed to handle various tasks such as merging objects, cloning objects, and manipulating data structures. However, versions of hoek prior to 4.2.1 and 5.0.3 are vulnerable to a prototype pollution attack.

Vulnerability Detail

The vulnerability in hoek arises from the merge function, as well as the applyToDefaults and applyToDefaultsWithShallow functions that internally use merge. When these functions are provided with an unvalidated payload created from a JSON string containing the __proto__ property, a prototype pollution attack can occur. This allows an attacker to overwrite existing properties, potentially leading to a denial of service.

How To Fix

Latest published version: 6.1.3 as of 22 Oct 2026

npm install hoek@6.1.3

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 4.2.1 4.2.1
    npm install hoek@4.2.1
  • >= 5.0.0, < 5.0.3 5.0.3
    npm install hoek@5.0.3

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

If updating to a patched version is not immediately feasible, a workaround can be implemented by validating and sanitizing any JSON payloads before passing them to the affected functions. This can be done by explicitly checking for the presence of the __proto__ property and rejecting payloads that contain it.

Conclusion

The vulnerability in hoek can be mitigated by updating to a patched version or implementing a workaround. It is crucial to address this issue promptly to prevent potential denial of service attacks. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for hoek →

Share this vulnerability

FAQ

Hoek is an npm package that provides utility functions for handling various tasks in Node.js modules.

Prototype pollution is a vulnerability that allows an attacker to modify the prototype of an object, leading to unexpected behavior and potential security issues.

The merge function, as well as the applyToDefaults and applyToDefaultsWithShallow functions that internally use merge, are affected by this vulnerability.

The prototype pollution attack in hoek can lead to the overwriting of existing properties, potentially causing a denial of service.

Updating to a patched version of hoek is the recommended mitigation. Alternatively, you can implement a workaround by validating and sanitizing JSON payloads before passing them to the affected functions.

How To Fix

Latest published version: 6.1.3 as of 22 Oct 2026

npm install hoek@6.1.3

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 4.2.1 4.2.1
    npm install hoek@4.2.1
  • >= 5.0.0, < 5.0.3 5.0.3
    npm install hoek@5.0.3

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback