PortGate

Advisories · Node.js & Next.js

CVE-2021-23337 High CVSS 7.2

lodash template command injection

Disclosed 2021 · Last reviewed 2 Dec 2026

lodash.template could run a command when the template options came from an attacker.

What happened

The template function wrote a function body from untrusted options.

Affected and patched versions

Affected
lodash before 4.17.21.
Patched
lodash 4.17.21 and later.

How to check your server

Check

npm ls lodash

How to fix and harden

  1. Upgrade lodash to 4.17.21 or later.
  2. Do not pass user input as template options.

Fix

npm ls lodash

Sources

Version ranges and fixes follow the vendor advisory. When a distribution backports a fix, trust its security tracker over the upstream version number. New advisories: RSS · JSON