CVE-2018-16487: Lodash Prototype Pollution Vulnerability

HIGH
Advisory Identifier: GHSA-4xc9-xhrj-v574
CWE-400
Published
Advisory Summary

CVE-2018-16487 is a HIGH prototype pollution vulnerability (CWE-400: Uncontrolled Resource Consumption) 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.11.

CVE-2018-16487 at a Glance

CVE Identifier CVE-2018-16487
GHSA Identifier GHSA-4xc9-xhrj-v574
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Lodash
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2018-16487

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.

lodash fixed: 4.17.11
npm install lodash@4.17.11
lodash-rails fixed: 4.17.11
Upgrade lodash-rails to 4.17.11
Verify Direct and Transitive Dependencies

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-16487, 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.11), 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-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. 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

Versions of `lodash` before 4.17.11 are vulnerable to prototype pollution. The vulnerable functions are 'defaultsDeep', 'merge', and 'mergeWith' which allow a malicious user to modify the prototype of `Object` via `{constructor: {prototype: {...}}}` causing the addition or modification of an existing property that will exist on all objects. ## Recommendation Update to version 4.17.11 or later.

CVE-2018-16487 Affected Lodash Versions

2 component(s)
Fixed Versions:
4.17.11
Product / Package Ecosystem Affected Versions Fixed Version
lodash
npm
< 4.17.11
4.17.11
lodash-rails
RubyGems
< 4.17.11
4.17.11

References

Frequently Asked Questions

What is CVE-2018-16487?
CVE-2018-16487 is a security vulnerability in Lodash involving Prototype Pollution in lodash under CWE-400: Uncontrolled Resource Consumption.
Which Lodash versions are affected?
Affected versions include releases prior to 4.17.11 across affected packages: lodash, lodash-rails.
What version fixes CVE-2018-16487?
Upgrading to 4.17.11 (or the latest patched release for your respective branch) resolves the vulnerability.
Is lodash affected?
Yes, lodash is affected in releases prior to 4.17.11. Upgrade your dependency to 4.17.11 or later.
Is lodash-rails affected?
Yes, lodash-rails is affected in releases prior to 4.17.11. Upgrade your dependency to 4.17.11 or later.
What CWE is associated with CVE-2018-16487?
CVE-2018-16487 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check npm dependencies for CVE-2018-16487?
Run the dependency tree command: 'npm ls lodash'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-4xc9-xhrj-v574",
  "modified" : "2025-08-12T21:36:47Z",
  "published" : "2019-02-07T18:16:48Z",
  "aliases" : [ "CVE-2018-16487" ],
  "summary" : "Prototype Pollution in lodash",
  "details" : "Versions of `lodash` before 4.17.11 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 `{constructor: {prototype: {...}}}` 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.11 or later.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "lodash"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.17.11"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "lodash-rails"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.17.11"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-16487"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/lodash/lodash/commit/90e6199a161b6445b01454517b40ef65ebecd2ad"
  }, {
    "type" : "WEB",
    "url" : "https://hackerone.com/reports/380873"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/lodash-rails/CVE-2018-16487.yml"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20190919-0004"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T20:59:41Z",
    "nvd_published_at" : null
  }
}