CVE-2021-23337 — Command Injection in lodash — CVE Details
Command Injection in lodash
What Should I Do?
Low-to-Moderate Risk
Exploitation probability is 20.61% in 30 days. Address in your next planned sprint.
Does your project use an affected lodash version?
Paste your package-lock.json to check it for CVE-2021-23337 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
lodash versions prior to 4.17.21 are vulnerable to Command Injection via the template function.
Advisory Timeline
- First published May 6, 2021 (2030 days ago).
- Last revised October 17, 2026 — 1989 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
npm install lodash@4.17.21
npm install lodash-es@4.17.21
gem install lodash-rails -v 4.17.21
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (5)
Affects 2 ecosystems: npm (4), RubyGems (1).
| Package | Fixed In |
|---|---|
| lodash npm · Affected: All versions | 4.17.21 |
| lodash-es npm · Affected: All versions | 4.17.21 |
| lodash-rails RubyGems · Affected: 0.10.0, 0.7.0, 0.8.1, 0.8.2 (+51 more) | 4.17.21 |
| lodash.template npm · Affected: All versions | Range-based data available |
| lodash-template npm · Affected: All versions | Range-based data available |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-77
- CWE-94Code InjectionMITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 7.2 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
References
- https://nvd.nist.gov/vuln/detail/CVE-2021-23337ADVISORY
- https://github.com/lodash/lodash/commit/3469357cff396a26c363f8c1b5a91dde28ba4b1cWEB
- https://www.oracle.com/security-alerts/cpuoct2021.htmlWEB
- https://www.oracle.com/security-alerts/cpujul2022.htmlWEB
- https://www.oracle.com/security-alerts/cpujan2022.htmlWEB
- https://www.oracle.com//security-alerts/cpujul2021.htmlWEB
- https://snyk.io/vuln/SNYK-JS-LODASH-1040724WEB
- https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-1074929WEB
- https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSBOWERGITHUBLODASH-1074931WEB
- https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSBOWER-1074928WEB
- https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARS-1074930WEB
- https://snyk.io/vuln/SNYK-JAVA-ORGFUJIONWEBJARS-1074932WEB
- https://security.netapp.com/advisory/ntap-20210312-0006WEB
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/lodash-rails/CVE-2021-23337.ymlWEB
- https://github.com/lodash/lodash/blob/ddfd9b11a0126db2302cb70ec9973b66baec0975/lodash.js#L14851WEB
- https://github.com/lodash/lodashPACKAGE
- https://cert-portal.siemens.com/productcert/pdf/ssa-637483.pdfWEB
Frequently Asked Questions
- What is CVE-2021-23337?
- Command Injection in lodash. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.2/10).
- How do I check if my project is affected by CVE-2021-23337?
- CVE-2021-23337 affects lodash, lodash-es and lodash-rails (and 2 more). It has a 20.6% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2021-23337 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
This places it in the top 5% of EPSS-scored vulnerabilities — 98.1% of tracked vulnerabilities score at or below it, so it is far more likely to be exploited than nearly all other tracked vulnerabilities.
Also Known As
Related CVEs
- CVE-2019-10744CRITICAL
Prototype Pollution in lodash
- CVE-2026-83816HIGH
CodeWhale: exec_shell parallel-readonly classifier auto-approves fd/rg/git grep exec flags enabling silent RCE
- CVE-2020-8203HIGH
Prototype Pollution in lodash
- CVE-2026-4800HIGH
lodash vulnerable to Code Injection via `_.template` imports key names
- CVE-2020-28500MEDIUM
Regular Expression Denial of Service (ReDoS) in lodash
- CVE-2026-2950MEDIUM
lodash vulnerable to prototype pollution via array-path bypass in `_.unset`, `_.omit`, and `_.pullAt
- CVE-2019-1010266MEDIUM
Regular Expression Denial of Service (ReDoS) in lodash
- CVE-2025-13465MEDIUM
Lodash has Prototype Pollution Vulnerability in `_.unset`, `_.omit`, and `_.pullAt` functions