Command Injection
Fix:upgrade the 3 affected packages Versions ↓
The flaw is a command injection vulnerability in the template function of Lodash, affecting versions prior to 4.17.21. An attacker with network access and high-level privileges (the vector indicates a privileges-required condition, with no user interaction needed) can inject commands through the template function to compromise the confidentiality, integrity and availability of the affected system.
Official description · CVE.org
Lodash versions prior to 4.17.21 are vulnerable to Command Injection via the template function.
- Exploited
- Yes, in VulnCheck KEV
- Reports
- 0
- Tactics
- 0/15
Exploitation timelineDated milestones for a CVE: when it was disclosed, when exploit code became public, when exploitation was confirmed, and when threat reports named it.
First seen exploited 6 years after disclosure. Public exploit code (PoC-in-GitHub) appeared 5 years after disclosure.
- Disclosedday 0
- Public exploit codePoC-in-GitHub+5 yrs
- First seen exploitedVulnCheck KEV evidence+6 yrs
Patch historyEarlier and later CVEs in the same code, in date order. It shows when a fix was bypassed or incomplete and which version finally fixed it.
2 related vulnerabilities in the same code over 5 years. The latest fix listed for lodash is 4.18.1.
Linked vulnerabilitiesLinked by evidence that a fix failed or the same code was patched again. Oldest first.
- This CVECVE-2021-23337Command Injection15 Feb 2021
relatedHigh
Why these are linked: Link confidenceHow strong the evidence is that two CVEs are related. High: stated in the CVE text or linked in an advisory, or the same code was patched one release apart. Medium: the same code, or a version step plus a similar description. Low: similar description only.
- Linked in OSV/GitHub advisoryGHSA-r5fr-rjxr-66jc
Fixes in lodashnpm package, by fixed version. Earlier and later fixes in the same package, not necessarily the same bug.
- 4.17.12CVE-2019-1074425 Jul 2019
- 4.17.19CVE-2020-820315 Jul 2020
- 4.17.21CVE-2020-2850015 Feb 2021
- 4.17.21CVE-2021-2333715 Feb 2021
- 4.17.23CVE-2025-1346521 Jan 2026
- 4.18.0CVE-2026-480031 Mar 2026
- 4.18.1CVE-2026-295031 Mar 2026Latest listed
Affected versions and fixes
as published in the CVE recordLodash
Affected: prior to 4.17.21
Am I affected? What do I upgrade to?
From GitHub Security Advisories and OSV5 packages in 2 ecosystems. No single main package: each of these ships the affected code.
- npmlodashAffected: All versions before 4.17.21Upgrade to 4.17.21 or later
- npmlodash-esAffected: All versions before 4.17.21Upgrade to 4.17.21 or later
- RubyGemslodash-railsAffected: All versions before 4.17.21Upgrade to 4.17.21 or later
- npmlodash.templateAffected: 4.5.0 and earlierNo fixed version published
- npmlodash-templateAffected: 1.0.0 and earlierNo fixed version published