Vulnerabilities/

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

Severity:
High

Description

The fix for CVE-2021-23337 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.

Recommendation

Update the lodash package to the latest compatible version. Followings are version details:

References

Related Issues

Tags:
npm
lodash
Anything's wrong? Let us know Last updated on April 01, 2026