Junglewise Threat Intelligence

lodash.defaultsdeep prototype pollution

Severity: info · Published 2020-09-03

Technologies: lodash.defaultsdeep (npm). Vendors: npm.

Executive brief

lodash.defaultsdeep is a JavaScript utility library function commonly used in Node.js applications to merge configuration objects. The vulnerability allows an attacker to inject malicious properties into JavaScript's Object prototype, causing unexpected behavior or bypasses in security checks across an entire application. This could lead to application logic errors or privilege escalation depending on how the affected code uses object properties.

Technical details

The vulnerability is a prototype pollution flaw in the defaultsDeep function (CWE-1321). When processing deeply nested objects, the function fails to sanitize the __proto__ property, allowing attackers to modify Object.prototype through specially crafted input objects. The attack vector is local/application-level: an attacker must control the input object structure passed to defaultsDeep, typically through JSON deserialization or user-supplied configuration. This can affect all objects created after the pollution occurs. The fix is available in version 4.6.1 and later.

Affected products

  • npm lodash.defaultsdeep < 4.6.1

Timeline

  • 2020-09-03: disclosed

References

Related threats