Vulnerabilities in pkg:npm/lodash.set

PACKAGE
Advisory Identifier: GHSA-p6mc-m468-83gw
Advisory Summary

CVE-2020-8203 is a HIGH (CVSS 7.4) 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.19, 4.17.20.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/lodash.set

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/lodash.set. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-p6mc-m468-83gw CVE-2020-8203 HIGH Prototype Pollution in lodash

CVE-2020-8203 at a Glance

CVE Identifier CVE-2020-8203
GHSA Identifier GHSA-p6mc-m468-83gw
Severity HIGH
CVSS v3.1 Base Score 7.4
CWE Classification CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
Affected Product Lodash
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2020-8203

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.19
npm install lodash@4.17.19
lodash-es fixed: 4.17.20
npm install lodash-es@4.17.20
lodash.pick fixed: Latest secure release
npm install lodash.pick@Latest secure release
lodash.set fixed: Latest secure release
npm install lodash.set@Latest secure release
lodash.setwith fixed: Latest secure release
npm install lodash.setwith@Latest secure release
lodash.update fixed: Latest secure release
npm install lodash.update@Latest secure release
lodash.updatewith fixed: Latest secure release
npm install lodash.updatewith@Latest secure release
lodash-rails fixed: 4.17.19
Upgrade lodash-rails to 4.17.19
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-2020-8203, 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.19), 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

Versions of lodash prior to 4.17.19 are vulnerable to Prototype Pollution. The functions `pick`, `set`, `setWith`, `update`, `updateWith`, and `zipObjectDeep` allow a malicious user to modify the prototype of Object if the property identifiers are user-supplied. Being affected by this issue requires manipulating objects based on user-provided property values or arrays. This vulnerability causes the addition or modification of an existing property that will exist on all objects and may lead to Denial of Service or Code Execution under specific circumstances.

CVE-2020-8203 Affected Lodash Versions

8 component(s)
Fixed Versions:
4.17.194.17.20
Product / Package Ecosystem Affected Versions Fixed Version
lodash
npm
≥ 3.7.0
< 4.17.19
4.17.19
lodash-es
npm
≥ 3.7.0
< 4.17.20
4.17.20
lodash.pick
npm
≥ 4.0.0
≤ 4.4.0
lodash.set
npm
≥ 3.7.0
≤ 4.3.2
lodash.setwith
npm
≤ 4.3.2
lodash.update
npm
≤ 4.10.2
lodash.updatewith
npm
≤ 4.10.2
lodash-rails
RubyGems
≥ 3.7.0
< 4.17.19
4.17.19

References

Frequently Asked Questions

What is CVE-2020-8203?
CVE-2020-8203 is a security vulnerability in Lodash involving Prototype Pollution in lodash under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution').
Which Lodash versions are affected?
Affected versions include releases prior to 4.17.19, 4.17.20 across affected packages: lodash, lodash-es, lodash.pick, lodash.set, lodash.setwith, lodash.update, lodash.updatewith, lodash-rails.
What version fixes CVE-2020-8203?
Upgrading to 4.17.19, 4.17.20 (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.19. Upgrade your dependency to 4.17.19 or later.
Is lodash-es affected?
Yes, lodash-es is affected in releases prior to 4.17.20. Upgrade your dependency to 4.17.20 or later.
What is the CVSS score of CVE-2020-8203?
CVE-2020-8203 has a CVSS v3.1 base score of 7.4 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:H.
What CWE is associated with CVE-2020-8203?
CVE-2020-8203 is classified under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution') (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.).
How can I check npm dependencies for CVE-2020-8203?
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-p6mc-m468-83gw",
  "modified" : "2025-08-12T21:43:38Z",
  "published" : "2020-07-15T19:15:48Z",
  "aliases" : [ "CVE-2020-8203" ],
  "summary" : "Prototype Pollution in lodash",
  "details" : "Versions of lodash prior to 4.17.19 are vulnerable to Prototype Pollution. The functions `pick`, `set`, `setWith`, `update`, `updateWith`, and `zipObjectDeep` allow a malicious user to modify the prototype of Object if the property identifiers are user-supplied. Being affected by this issue requires manipulating objects based on user-provided property values or arrays.\n\nThis vulnerability causes the addition or modification of an existing property that will exist on all objects and may lead to Denial of Service or Code Execution under specific circumstances.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "lodash"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.7.0"
      }, {
        "fixed" : "4.17.19"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "lodash-es"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.7.0"
      }, {
        "fixed" : "4.17.20"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "lodash.pick"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0"
      }, {
        "last_affected" : "4.4.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "lodash.set"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.7.0"
      }, {
        "last_affected" : "4.3.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "lodash.setwith"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "4.3.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "lodash.update"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "4.10.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "lodash.updatewith"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "4.10.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "lodash-rails"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.7.0"
      }, {
        "fixed" : "4.17.19"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-8203"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/lodash/lodash/issues/4744"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/lodash/lodash/issues/4874"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/github/advisory-database/pull/2884"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/lodash/lodash/commit/c84fe82760fb2d3e03a63379b297a1cc1a2fce12"
  }, {
    "type" : "WEB",
    "url" : "https://hackerone.com/reports/712065"
  }, {
    "type" : "WEB",
    "url" : "https://hackerone.com/reports/864701"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/lodash/lodash"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/lodash/lodash/wiki/Changelog#v41719"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/lodash-rails/CVE-2020-8203.yml"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20200724-0006"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20210914001339/https://github.com/lodash/lodash/issues/4744"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1321", "CWE-770" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-07-15T19:14:58Z",
    "nvd_published_at" : "2020-07-15T17:15:00Z"
  }
}