# hapi hoek prototype pollution in clone function

Source: https://junglewise.ai/threats/hapi-hoek-prototype-pollution-in-clone-function-0f3b2840  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2020-09-04. Updated: 2026-05-13  
License: CC BY 4.0 with a link back

Severity: info · CVSS 3.7 · Published 2020-09-04

A vulnerability exists in the @hapi/hoek utility library, which provides general-purpose helper functions for Node.js applications. An attacker can provide specially crafted data that modifies the base behavior of all objects within the application. This could potentially lead to application crashes or, in rare and specific configurations, allow for unauthorized code execution.

Vendors: [Hapi](https://junglewise.ai/threats/vendors/hapi).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** Informational severity, with a CVSS score of 3.7, published 4 September 2020.

**Which products and versions are affected?** Hapi Hoek >= 8.3.2, < 8.5.1.

**Is there a fix for This vulnerability?** A patch was published on 2020-08-31: Fixes released in versions 8.5.1 and 9.0.3 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is This vulnerability attacked?** It is attacked over the network, in a software library.

**Am I affected?** Check whether you run Hapi Hoek at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

The @hapi/hoek library is vulnerable to prototype pollution (CWE-1321) within its `clone` function. The function fails to properly sanitize or restrict the modification of the `Object.prototype` when processing specially crafted input. An attacker can exploit this by injecting properties into the global object prototype, which are then inherited by all objects in the Node.js environment. While the hapi framework itself includes protections against this, standalone usage of the library is at risk. Depending on the application's logic, this can result in Denial of Service (DoS) or Remote Code Execution (RCE). The issue is resolved in versions 8.5.1 and 9.0.3.

## Affected products

- hapi @hapi/hoek >= 8.3.2, < 8.5.1
- hapi @hapi/hoek >= 9.0.0, < 9.0.3

## Timeline

- 2020-08-31: patched: Fixes released in versions 8.5.1 and 9.0.3
- 2020-09-04: disclosed: Advisory published on GitHub/OSV

## References

- [https://www.npmjs.com/advisories/1468](https://www.npmjs.com/advisories/1468)

## Related threats

- [hapi hoek prototype pollution in clone function](https://junglewise.ai/threats/cve-2020-36604-hapi-hoek-prototype-pollution-in-clone-function)
