Prototype Pollution in underscore.deep
Description
Underscore.deep is a collection of Underscore mixins that operate on nested objects. Versions of underscore.deep prior to version 0.5.3 are vulnerable to a prototype pollution vulnerability. An attacker can craft a malicious payload and pass it to deepFromFlat, which would pollute any future Objects created. Any users that have deepFromFlat or deepPick (due to its dependency on deepFromFlat) in their code should upgrade to version 0.5.3 as soon as possible. Users unable to upgrade may mitigate this issue by modifying deepFromFlat to prevent specific keywords which will prevent this from happening.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected products
2<0.5.3+ 1 more
- (no CPE)range: <0.5.3
- (no CPE)range: < 0.5.3
Patches
Vulnerability mechanics
Root cause
"The `deepFromFlat` function does not properly sanitize keys, allowing for prototype pollution."
Attack vector
An attacker can exploit this vulnerability by providing a specially crafted payload to the `deepFromFlat` function. This payload would include keys such as `__proto__.polluted1` or `constructor.prototype.polluted2`. When processed, these keys can modify the `Object.prototype`, affecting all subsequent objects created in the application. This vulnerability is also present in `deepPick` due to its reliance on `deepFromFlat` [ref_id=1].
Affected code
The vulnerability resides in the `deepFromFlat` function within the `underscore.deep` library. Specifically, the issue occurs in the loop that processes the `parts` array, where keys are used to traverse and build the nested object structure. The patch adds a condition to skip processing parts that are `__proto__`, `constructor`, or `prototype` [ref_id=1].
What the fix does
The patch modifies the `deepFromFlat` function to include a check for specific keywords within the `parts` array. If a part is found to be `__proto__`, `constructor`, or `prototype`, the loop continues to the next iteration, effectively skipping these potentially malicious keys. This prevents the modification of the global `Object.prototype` and mitigates the prototype pollution vulnerability [ref_id=1].
Preconditions
- inputThe application must use a version of `underscore.deep` prior to 0.5.3.
- inputThe application must call `deepFromFlat` or `deepPick` with user-controlled input.
Generated on Jun 10, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
2- github.com/Clever/underscore.deep/commit/b5e109ad05b48371be225fa4d490dd08a94e8ef7mitrex_refsource_MISC
- github.com/Clever/underscore.deep/security/advisories/GHSA-8j79-hfj5-f2xmmitrex_refsource_CONFIRM
News mentions
0No linked articles in our index yet.