# lodash.mergewith prototype pollution

Source: https://junglewise.ai/threats/lodash-mergewith-prototype-pollution-300b919a  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2020-09-03. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

Severity: info · Published 2020-09-03

lodash.mergewith is a JavaScript utility function used to merge objects in web applications. Affected versions allow an attacker to inject malicious properties into the prototype of all objects, potentially compromising application behavior, data integrity, and security controls that rely on object properties.

Vendors: [Lodash](https://junglewise.ai/threats/vendors/lodash), [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** Informational severity, published 3 September 2020.

**Which products and versions are affected?** Lodash Mergewith before 4.6.2; lodash.mergewith (npm) SEMVER:introduced=0,fixed=4.6.2.

**Is there a fix for This vulnerability?** Yes. lodash.mergewith (npm): upgrade to 4.6.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is This vulnerability attacked?** It is attacked over the network, in a software library.

**Am I affected?** Check whether you run Lodash Mergewith or lodash.mergewith (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- lodash.mergewith (npm): upgrade to 4.6.2 or later

  ```sh
  npm install lodash.mergewith@4.6.2
  ```


## Technical details

Prototype pollution vulnerability in lodash.mergewith (versions before 4.6.2) allows an attacker to modify the Object prototype via a crafted input object with a {constructor: {prototype: {...}}} structure. This occurs because the mergeWith function recursively merges user-supplied objects without sufficient restrictions on property manipulation. The attack requires only that an application calls mergeWith with untrusted data; network access and authentication are not barriers. A successful exploit can add or modify properties on all objects in the application, leading to authorization bypass, logic errors, or denial of service. The fix is available in version 4.6.2 and later.

## Affected products

- lodash mergewith before 4.6.2

## Timeline

- 2020-09-03: disclosed

## References

- [https://www.npmjs.com/advisories/1071](https://www.npmjs.com/advisories/1071)

## Related threats

- [lodash.mergewith prototype pollution](https://junglewise.ai/threats/lodash-mergewith-prototype-pollution-d60919df)
