Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2024-23339 Overview
CVE-2024-23339 is a prototype pollution vulnerability in hoolock, a lightweight JavaScript utility library for Node.js environments. The flaw affects versions 2.0.0 through 2.2.0. The object path utilities get, set, and update fail to block access to inherited properties, allowing attackers to read or alter object prototypes. The maintainer, elijahharry, released version 2.2.1 to address the issue by throwing a TypeError when callers attempt to traverse into prototype chains. The weakness is classified under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes.
Critical Impact
Attackers reaching vulnerable hoolock object path functions with controlled input can poison Object.prototype, leading to logic tampering, data disclosure, or downstream code execution in dependent applications.
Affected Products
- hoolock versions >= 2.0.0 and < 2.2.1
- Node.js applications bundling the affected hoolock releases
- Downstream packages depending on vulnerable hoolock versions
Discovery Timeline
- 2024-01-22 - CVE-2024-23339 published to the National Vulnerability Database
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2024-23339
Vulnerability Analysis
The hoolock library provides path-based object utilities commonly used to read, write, or merge nested properties using dot notation. In versions 2.0.0 through 2.2.0, the get, set, and update helpers walk property keys without filtering reserved prototype names. When a key segment resolves to __proto__, prototype, or constructor, the operation traverses or mutates the prototype chain instead of the intended own property.
This class of flaw, prototype pollution, affects shared object templates across the entire JavaScript runtime. A single poisoned attribute propagates to every object inheriting from the polluted prototype. The result can include authentication bypass, altered application logic, or secondary injection sinks depending on how the host application consumes those properties.
The network attack vector reflects typical exposure through HTTP APIs that forward user-supplied JSON into hoolock path helpers.
Root Cause
The root cause is missing allowlist or denylist validation on path segments passed to get, set, and update. The functions treat __proto__, constructor, and prototype as ordinary keys. Patched builds throw a TypeError when the resolved property is inherited rather than owned, blocking traversal into the prototype chain.
Attack Vector
Exploitation requires an application that forwards attacker-controlled key paths or JSON structures into one of the affected helpers. An attacker submits a payload containing a prototype-reserved segment such as __proto__.polluted with an assigned value. After the set or update call, every subsequently created plain object inherits the injected property. The attacker then triggers application code paths that read the polluted attribute to influence authorization checks, template rendering, or command assembly.
For technical reproduction details, see the GitHub Security Advisory GHSA-4c2g-hx49-7h25 and the upstream fix commit.
Detection Methods for CVE-2024-23339
Indicators of Compromise
- HTTP request bodies or query parameters containing the strings __proto__, constructor.prototype, or prototype. in JSON keys or dot-path values.
- Application error logs containing TypeError entries originating from hoolockget, set, or update call sites after upgrading to 2.2.1.
- Unexpected properties appearing on freshly instantiated plain objects during runtime inspection.
Detection Strategies
- Perform a software composition analysis scan of package-lock.json and yarn.lock files for hoolock versions below 2.2.1.
- Instrument runtime guards that compare Object.prototype keys against a known baseline and alert on drift.
- Add web application firewall rules that inspect inbound JSON for prototype-reserved keys.
Monitoring Recommendations
- Monitor Node.js process logs for repeated TypeError exceptions tied to object path utilities.
- Track dependency manifests across build pipelines to flag reintroduction of vulnerable hoolock releases.
- Alert on anomalous property enumerations in sensitive code paths such as authentication, templating, and command construction.
How to Mitigate CVE-2024-23339
Immediate Actions Required
- Upgrade hoolock to version 2.2.1 or later across all applications and build artifacts.
- Audit application code for direct use of get, set, and update with user-controlled key paths.
- Validate and reject input containing __proto__, constructor, or prototype segments before invoking any path helper.
Patch Information
The fix shipped in hoolock2.2.1. Starting with that release, get, set, and update throw a TypeError when callers attempt to access or modify inherited properties. The patch is published in the commit 97ae80e and documented in GHSA-4c2g-hx49-7h25.
Workarounds
- Wrap vulnerable helper calls with a validator that rejects reserved prototype key names before delegation.
- Freeze Object.prototype at process startup using Object.freeze(Object.prototype) where application compatibility permits.
- Deserialize untrusted JSON using parsers that strip __proto__ keys, such as JSON.parse with a reviver function.
# Upgrade hoolock to the patched release
npm install hoolock@^2.2.1
# Verify the installed version
npm ls hoolock
# Audit the full dependency tree for lingering vulnerable copies
npm audit --production
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

