CVE-2022-31106: CWE-915: Improperly Controlled Modification of Dynamically-Determined Object Attributes in Clever underscore.deep
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 Analysis
Technical Summary
CVE-2022-31106 is a prototype pollution vulnerability affecting versions of the JavaScript library underscore.deep prior to 0.5.3. Underscore.deep is a set of mixins extending the popular Underscore.js library, designed to operate on nested objects. The vulnerability arises in the function deepFromFlat, which converts flat objects into deeply nested ones. An attacker can craft a malicious payload that manipulates the prototype chain of JavaScript objects by injecting properties into the Object prototype. This occurs because deepFromFlat does not properly validate or sanitize keys that can modify prototype attributes, allowing an attacker to inject or overwrite properties on Object.prototype. Since deepPick depends on deepFromFlat, it is also indirectly vulnerable. Prototype pollution can lead to unexpected behavior in applications, including denial of service, data corruption, or privilege escalation, by altering the behavior of all objects inheriting from Object.prototype. The vulnerability does not require authentication or user interaction, making it easier to exploit in environments where vulnerable versions are used. Although no known exploits have been reported in the wild, the risk remains significant due to the widespread use of underscore.deep in JavaScript projects. The recommended remediation is to upgrade underscore.deep to version 0.5.3 or later, where the issue is fixed. For users unable to upgrade immediately, modifying deepFromFlat to block specific prototype keys (such as __proto__, constructor, and prototype) can mitigate the risk.
Potential Impact
For European organizations, this vulnerability poses a moderate risk primarily to web applications and services using JavaScript stacks that include underscore.deep versions prior to 0.5.3. Successful exploitation can lead to prototype pollution, which may cause application logic errors, data integrity issues, or denial of service conditions. In sensitive environments, this could enable attackers to escalate privileges or bypass security controls by manipulating object behavior globally within the application context. Organizations in sectors such as finance, healthcare, and critical infrastructure, which rely heavily on web applications, could face operational disruptions or data breaches if this vulnerability is exploited. Additionally, the vulnerability could be leveraged as a foothold for further attacks within internal networks if exploited in client-side or server-side JavaScript environments. The lack of authentication or user interaction requirements increases the attack surface, especially for publicly accessible applications. However, the absence of known active exploits suggests the threat is currently moderate but should not be underestimated.
Mitigation Recommendations
1. Immediate upgrade of underscore.deep to version 0.5.3 or later is the most effective mitigation. 2. For environments where upgrading is not feasible, patch the deepFromFlat function to explicitly reject or sanitize keys that can modify the prototype chain, such as '__proto__', 'constructor', and 'prototype'. 3. Conduct a thorough dependency audit across all JavaScript projects to identify usage of vulnerable underscore.deep versions. 4. Implement runtime application self-protection (RASP) or input validation mechanisms to detect and block suspicious payloads attempting prototype pollution. 5. Employ security-focused code reviews and static analysis tools that can detect prototype pollution patterns. 6. Monitor application logs for anomalies indicative of prototype pollution attempts, such as unexpected object behavior or errors related to object properties. 7. Educate development teams about the risks of prototype pollution and secure coding practices to prevent similar vulnerabilities in custom code.
Affected Countries
Germany, France, United Kingdom, Netherlands, Italy, Spain, Poland, Sweden
CVE-2022-31106: CWE-915: Improperly Controlled Modification of Dynamically-Determined Object Attributes in Clever 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-Powered Analysis
Technical Analysis
CVE-2022-31106 is a prototype pollution vulnerability affecting versions of the JavaScript library underscore.deep prior to 0.5.3. Underscore.deep is a set of mixins extending the popular Underscore.js library, designed to operate on nested objects. The vulnerability arises in the function deepFromFlat, which converts flat objects into deeply nested ones. An attacker can craft a malicious payload that manipulates the prototype chain of JavaScript objects by injecting properties into the Object prototype. This occurs because deepFromFlat does not properly validate or sanitize keys that can modify prototype attributes, allowing an attacker to inject or overwrite properties on Object.prototype. Since deepPick depends on deepFromFlat, it is also indirectly vulnerable. Prototype pollution can lead to unexpected behavior in applications, including denial of service, data corruption, or privilege escalation, by altering the behavior of all objects inheriting from Object.prototype. The vulnerability does not require authentication or user interaction, making it easier to exploit in environments where vulnerable versions are used. Although no known exploits have been reported in the wild, the risk remains significant due to the widespread use of underscore.deep in JavaScript projects. The recommended remediation is to upgrade underscore.deep to version 0.5.3 or later, where the issue is fixed. For users unable to upgrade immediately, modifying deepFromFlat to block specific prototype keys (such as __proto__, constructor, and prototype) can mitigate the risk.
Potential Impact
For European organizations, this vulnerability poses a moderate risk primarily to web applications and services using JavaScript stacks that include underscore.deep versions prior to 0.5.3. Successful exploitation can lead to prototype pollution, which may cause application logic errors, data integrity issues, or denial of service conditions. In sensitive environments, this could enable attackers to escalate privileges or bypass security controls by manipulating object behavior globally within the application context. Organizations in sectors such as finance, healthcare, and critical infrastructure, which rely heavily on web applications, could face operational disruptions or data breaches if this vulnerability is exploited. Additionally, the vulnerability could be leveraged as a foothold for further attacks within internal networks if exploited in client-side or server-side JavaScript environments. The lack of authentication or user interaction requirements increases the attack surface, especially for publicly accessible applications. However, the absence of known active exploits suggests the threat is currently moderate but should not be underestimated.
Mitigation Recommendations
1. Immediate upgrade of underscore.deep to version 0.5.3 or later is the most effective mitigation. 2. For environments where upgrading is not feasible, patch the deepFromFlat function to explicitly reject or sanitize keys that can modify the prototype chain, such as '__proto__', 'constructor', and 'prototype'. 3. Conduct a thorough dependency audit across all JavaScript projects to identify usage of vulnerable underscore.deep versions. 4. Implement runtime application self-protection (RASP) or input validation mechanisms to detect and block suspicious payloads attempting prototype pollution. 5. Employ security-focused code reviews and static analysis tools that can detect prototype pollution patterns. 6. Monitor application logs for anomalies indicative of prototype pollution attempts, such as unexpected object behavior or errors related to object properties. 7. Educate development teams about the risks of prototype pollution and secure coding practices to prevent similar vulnerabilities in custom code.
Affected Countries
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2022-05-18T00:00:00.000Z
- Cisa Enriched
- true
Threat ID: 682d9849c4522896dcbf665f
Added to database: 5/21/2025, 9:09:29 AM
Last enriched: 6/22/2025, 12:35:54 AM
Last updated: 7/30/2025, 3:17:31 AM
Views: 12
Related Threats
CVE-2025-9053: SQL Injection in projectworlds Travel Management System
MediumCVE-2025-9052: SQL Injection in projectworlds Travel Management System
MediumCVE-2025-9019: Heap-based Buffer Overflow in tcpreplay
LowCVE-2025-9017: Cross Site Scripting in PHPGurukul Zoo Management System
MediumCVE-2025-9051: SQL Injection in projectworlds Travel Management System
MediumActions
Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.
External Links
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.