high Patched

lodash vulnerable to Code Injection via `_.template` imports key names

CVE-2026-4800 · GHSA-r5fr-rjxr-66jc · published 1 Apr 2026

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-2026-4800?

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.0.0, < 4.18.0
  • lodash-es (npm) >= 4.0.0, < 4.18.0
  • lodash-amd (npm) >= 4.0.0, < 4.18.0
  • lodash.template (npm) >= 4.0.0, < 4.18.0

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-amd 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. Or paste your lockfile into the checker: it lists every package with a known vulnerability, this one included.
  6. 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.0.0, < 4.18.0: Upgrade lodash to 4.18.0 or later, commit the lockfile and redeploy.
  2. On >= 4.0.0, < 4.18.0: Upgrade lodash-es to 4.18.0 or later, commit the lockfile and redeploy.
  3. On >= 4.0.0, < 4.18.0: Upgrade lodash-amd to 4.18.0 or later, commit the lockfile and redeploy.
  4. On >= 4.0.0, < 4.18.0: Upgrade lodash.template to 4.18.0 or later, commit the lockfile and redeploy.
  5. If a vulnerable version was live, check your logs and rotate the secrets that server could read.

The advisory

### Impact The fix for [CVE-2021-23337](https://github.com/advisories/GHSA-35jh-r3h4-6jhm) added validation for the `variable` option in `_.template` but did not apply the same validation to `options.imports` key names. Both paths flow into the same `Function()` constructor sink. When an application passes untrusted input as `options.imports` key names, an attacker can inject default-parameter expressions that execute arbitrary code at template compilation time. Additionally, `_.template` uses `assignInWith` to merge imports, which enumerates inherited properties via `for..in`. If `Object.prototype` has been polluted by any other vector, the polluted keys are copied into the imports object and passed to `Function()`. ### Patches Users should upgrade to version 4.18.0. The fix applies two changes: 1. Validate `importsKeys` against the existing `reForbiddenIdentifierChars` regex (same check already used for the `variable` option) 2. Replace `assignInWith` with `assignWith` when merging imports, so only own properties are enumerated ### Workarounds Do not pass untrusted input as key names in `options.imports`. Only use developer-controlled, static key names.

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