Command Injection in lodash
CVE-2021-23337 · GHSA-35jh-r3h4-6jhm · published 6 May 2021
How serious is it
- Severity: high.
- No exploit prediction (EPSS) score yet.
- Not on the CISA list of exploited vulnerabilities.
- No public exploit in Exploit-DB.
Is your app affected by CVE-2021-23337?
Paste this prompt into Claude Code, Cursor or any AI coding tool: it runs a free Shippable scan of your project and fixes what it finds. Built with Lovable, Bolt or v0? Scan your live app. Or upload your package file.
Who is affected
lodash(npm) < 4.17.21lodash-es(npm) < 4.17.21lodash.template(npm) <= 4.5.0lodash-template(npm) <= 1.0.0lodash-rails(RubyGems) < 4.17.21
How to check
- Run
npm ls lodashin your project to see the installed version, including copies pulled in by other packages. - Run
npm ls lodash-esin your project to see the installed version, including copies pulled in by other packages. - Run
npm ls lodash.templatein your project to see the installed version, including copies pulled in by other packages. - Run
npm ls lodash-templatein your project to see the installed version, including copies pulled in by other packages. - Run
bundle info lodash-railsin your project to see the installed version, including copies pulled in by other packages. - Or paste your lockfile into the checker: it lists every package with a known vulnerability, this one included.
- Or run
npx shippable-dev scan localhost:3000in your project folder. It reads your lockfile and flags this vulnerability along with every other known one.
How to fix
Copies a prompt for Claude Code, Cursor or Codex: it checks your lockfiles for this and upgrades it.
- On < 4.17.21: Upgrade
lodashto 4.17.21 or later, commit the lockfile and redeploy. - On < 4.17.21: Upgrade
lodash-esto 4.17.21 or later, commit the lockfile and redeploy. - No fixed version of
lodash.templateyet. Replace or remove it, or apply the workaround in the advisory below. - No fixed version of
lodash-templateyet. Replace or remove it, or apply the workaround in the advisory below. - On < 4.17.21: Upgrade
lodash-railsto 4.17.21 or later, commit the lockfile and redeploy. - If a vulnerable version was live, check your logs and rotate the secrets that server could read.
The advisory
`lodash` versions prior to 4.17.21 are vulnerable to Command Injection via the template function.
Check your whole app
Dependencies are only half of it. Free and read-only: before you push, run npx shippable-dev scan localhost:3000 in your project folder, no account needed. For your live app, you prove it's yours with a one-line tag first.
References
- nvd.nist.gov/vuln/detail/CVE-2021-23337
- github.com/lodash/lodash/commit/3469357cff396a26c363f8c1b5a91dde28ba4b1c
- www.oracle.com/security-alerts/cpuoct2021.html
- www.oracle.com/security-alerts/cpujul2022.html
- www.oracle.com/security-alerts/cpujan2022.html
- www.oracle.com//security-alerts/cpujul2021.html
- snyk.io/vuln/SNYK-JS-LODASH-1040724
- snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-1074929
- snyk.io/vuln/SNYK-JAVA-ORGWEBJARSBOWERGITHUBLODASH-1074931
- snyk.io/vuln/SNYK-JAVA-ORGWEBJARSBOWER-1074928
- snyk.io/vuln/SNYK-JAVA-ORGWEBJARS-1074930
- snyk.io/vuln/SNYK-JAVA-ORGFUJIONWEBJARS-1074932
- security.netapp.com/advisory/ntap-20210312-0006
- github.com/rubysec/ruby-advisory-db/blob/master/gems/lodash-rails/CVE-2021-23337.yml
- github.com/lodash/lodash/blob/ddfd9b11a0126db2302cb70ec9973b66baec0975/lodash.js#L14851
Merged from OSV. Last updated 23 Oct 2026. All vulnerabilities · RSS · JSON