high Partly patched

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.21
  • lodash-es (npm) < 4.17.21
  • lodash.template (npm) <= 4.5.0
  • lodash-template (npm) <= 1.0.0
  • lodash-rails (RubyGems) < 4.17.21

How to check

  1. Run npm ls lodash in your project to see the installed version, including copies pulled in by other packages.
  2. Run npm ls lodash-es in your project to see the installed version, including copies pulled in by other packages.
  3. Run npm ls lodash.template in your project to see the installed version, including copies pulled in by other packages.
  4. Run npm ls lodash-template in your project to see the installed version, including copies pulled in by other packages.
  5. Run bundle info lodash-rails in your project to see the installed version, including copies pulled in by other packages.
  6. Or paste your lockfile into the checker: it lists every package with a known vulnerability, this one included.
  7. Or run npx shippable-dev scan localhost:3000 in 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.
  1. On < 4.17.21: Upgrade lodash to 4.17.21 or later, commit the lockfile and redeploy.
  2. On < 4.17.21: Upgrade lodash-es to 4.17.21 or later, commit the lockfile and redeploy.
  3. No fixed version of lodash.template yet. Replace or remove it, or apply the workaround in the advisory below.
  4. No fixed version of lodash-template yet. Replace or remove it, or apply the workaround in the advisory below.
  5. On < 4.17.21: Upgrade lodash-rails to 4.17.21 or later, commit the lockfile and redeploy.
  6. 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

Merged from OSV. Last updated 23 Oct 2026. All vulnerabilities · RSS · JSON