CVE-2018-3721: Lodash Prototype Pollution Vulnerability
MODERATECVE-2018-3721 is a MODERATE (CVSS 6.5) prototype pollution vulnerability (CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')) affecting Lodash libraries in the npm ecosystem. The issue involves prototype pollution in lodash. Remediation is available by upgrading affected packages to version 4.17.5.
CVE-2018-3721 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N).
How to Fix CVE-2018-3721
To remediate this vulnerability, upgrade all affected Lodash dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install lodash@4.17.5
Upgrade lodash-rails to 4.17.5
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls lodash
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2018-3721, inspect your project dependencies using npm:
npm ls lodash
Analyze the terminal output to locate any version of Lodash in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.17.5), your application is affected.
Note: The npm ls lodash command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution'), where the product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype. In Lodash, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2018-3721 Affected Lodash Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
lodash
|
npm |
< 4.17.5
|
4.17.5
|
|
lodash-rails
|
RubyGems |
< 4.17.5
|
4.17.5
|
References
Frequently Asked Questions
What is CVE-2018-3721?
Which Lodash versions are affected?
What version fixes CVE-2018-3721?
Is lodash affected?
Is lodash-rails affected?
What is the CVSS score of CVE-2018-3721?
What CWE is associated with CVE-2018-3721?
How can I check npm dependencies for CVE-2018-3721?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-fvqr-27wr-82fm",
"modified" : "2025-08-12T21:37:06Z",
"published" : "2018-07-26T15:14:52Z",
"aliases" : [ "CVE-2018-3721" ],
"summary" : "Prototype Pollution in lodash",
"details" : "Versions of `lodash` before 4.17.5 are vulnerable to prototype pollution. \n\nThe vulnerable functions are 'defaultsDeep', 'merge', and 'mergeWith' which allow a malicious user to modify the prototype of `Object` via `__proto__` causing the addition or modification of an existing property that will exist on all objects.\n\n\n\n\n## Recommendation\n\nUpdate to version 4.17.5 or later.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "lodash"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.17.5"
} ]
} ]
}, {
"package" : {
"ecosystem" : "RubyGems",
"name" : "lodash-rails"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.17.5"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-3721"
}, {
"type" : "WEB",
"url" : "https://github.com/lodash/lodash/commit/d8e069cc3410082e44eb18fcf8e7f3d08ebe1d4a"
}, {
"type" : "WEB",
"url" : "https://hackerone.com/reports/310443"
}, {
"type" : "WEB",
"url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/lodash-rails/CVE-2018-3721.yml"
}, {
"type" : "WEB",
"url" : "https://security.netapp.com/advisory/ntap-20190919-0004"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1321", "CWE-471" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2020-06-16T21:35:26Z",
"nvd_published_at" : "2018-06-07T02:29:08Z"
}
}