Prototype Pollution in lodash.defaultsdeep

lodash.defaultsdeep Updated 02 Oct 2025

Summary

03/09/2020
HIGH
Yes i
High
Not published

GHSA-h5mp-5q4p-ggf5: Prototype Pollution in lodash.defaultsdeep. Affects lodash.defaultsdeep versions < 4.6.1. Fixed in 4.6.1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

lodash.defaultsdeep is an npm package that provides a function for merging objects deeply. It is commonly used in JavaScript applications to merge default configuration objects with user-defined options. The package allows developers to merge objects recursively, ensuring that nested properties are combined correctly. However, versions of lodash.defaultsdeep prior to 4.6.1 are vulnerable to prototype pollution.

Vulnerability Detail

Prototype pollution is a vulnerability that occurs when an application allows user-controlled input to modify the prototype of an object. In the case of lodash.defaultsdeep, the function mergeWith can be exploited by a malicious user to modify the prototype of the Object constructor. By passing {constructor: {prototype: {...}}} as an argument, the attacker can add or modify properties that will exist on all objects. This can lead to unexpected behavior and potential security issues.

How To Fix

Latest published version: 4.6.1 as of 23 Oct 2026

npm install lodash.defaultsdeep@4.6.1

The newest release already contains this fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no known workaround for this vulnerability. It is essential to update to the fixed version of the package to mitigate the risk of prototype pollution.

Conclusion

Prototype pollution in lodash.defaultsdeep can be a serious security vulnerability that allows an attacker to modify the prototype of the Object constructor. To mitigate this risk, it is crucial to update the package to version 4.6.1 or later. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for lodash.defaultsdeep →

Share this vulnerability

FAQ

Prototype pollution is a vulnerability that occurs when an application allows user-controlled input to modify the prototype of an object. This can lead to unexpected behavior and potential security issues.

lodash.defaultsdeep provides a function called mergeWith that allows developers to merge objects deeply. It ensures that nested properties are combined correctly.

The impact of this vulnerability depends on how the affected package is used in an application. If the package is used to merge user-defined options with default configuration objects, an attacker could modify the prototype of the Object constructor and introduce unexpected behavior or security issues.

Yes, updating lodash.defaultsdeep to version 4.6.1 or later fixes the prototype pollution issue. It is recommended to update the package to mitigate the risk.

There are no known workarounds for this vulnerability. Updating to the fixed version of the package is the recommended solution.

Related vulnerabilities

Recent vulnerabilities recorded for lodash.defaultsdeep.

How To Fix

Latest published version: 4.6.1 as of 23 Oct 2026

npm install lodash.defaultsdeep@4.6.1

The newest release already contains this fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback