Lodash Command Injection Vulnerability

Vulnerability

A command injection vulnerability has been identified in Lodash versions prior to 4.17.21. The issue arises in the template function, where improper validation of key names allows for the execution of arbitrary code. This vulnerability is particularly concerning because it could lead to the disclosure of sensitive information, unauthorized data modification, or a denial-of-service condition.

Impact

Exploitation of this vulnerability could result in command injection, allowing attackers to execute arbitrary code in the context of the application.

Reproduction

To reproduce this vulnerability, use a version of Lodash prior to 4.17.21. The vulnerability can be triggered by calling the template function with a payload that includes malicious expressions in the variable key names. For example, injecting a variable name that, when executed, logs sensitive information such as environment variables.

Remediation

Upgrade Lodash to version 4.17.21 or later.

Added: Jun 22, 2026, 12:22 PM
Updated: Jun 22, 2026, 12:22 PM

Vulnerability Rating

Custom Algorithm
spread
7.8
impact
7.5
exploitability
6.0
remediation
7.7
relevance
0.0
threat
6.8
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.