lodash vulnerable to Code Injection via `_.template` imports key names
Default status is the baseline for the product, each version can override it (e.g. patched versions marked unaffected).
| Vendor | Product | Default status | Versions | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| lodash | lodash | unaffected |
|
|||||||||
| lodash | lodash-es | unaffected |
|
|||||||||
| lodash | lodash-amd | unaffected |
|
|||||||||
| lodash | lodash.template | unaffected |
|
Configuration 1 [-]
|
No data.
| Vendor | Product | Versions | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Lodash | Lodash |
|
||||||||||||
| Lodash | Lodash.template |
|
| Source | ID | Title |
|---|---|---|
Debian DLA |
DLA-4663-1 | node-lodash security update |
Debian DLA |
DLA-4820-1 | node-lodash security update |
Github GHSA |
GHSA-r5fr-rjxr-66jc | lodash vulnerable to Code Injection via `_.template` imports key names |
Ubuntu USN |
USN-8411-1 | Lodash vulnerabilities |
No CVSS v4.0
No CVSS v3.0
No CVSS v2
This CVE is not in the KEV list.
Exploit prediction score: 2.8% (2.808% probability within 30 days)
| Type | Values Removed | Values Added |
|---|---|---|
| Description | 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. Workarounds: Do not pass untrusted input as key names in options.imports. Only use developer-controlled, static key names. | 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, and 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, so if Object.prototype has been polluted by another vector the polluted keys are copied into the imports object and passed to Function(). The issue is fixed in 4.18.1 for lodash, lodash-es, lodash-amd, and lodash.template. As a workaround, do not pass untrusted input as key names in options.imports; use only developer-controlled, static key names. |
| References |
|
| Type | Values Removed | Values Added |
|---|---|---|
| References |
|
| Type | Values Removed | Values Added |
|---|---|---|
| References |
|
| Type | Values Removed | Values Added |
|---|---|---|
| References |
|
| Type | Values Removed | Values Added |
|---|---|---|
| References |
|
| Type | Values Removed | Values Added |
|---|---|---|
| References |
|
| Type | Values Removed | Values Added |
|---|---|---|
| References |
|
| Type | Values Removed | Values Added |
|---|---|---|
| First Time appeared |
Lodash lodash-amd
|
|
| CPEs | cpe:2.3:a:lodash:lodash-amd:*:*:*:*:*:node.js:*:* | |
| Vendors & Products |
Lodash lodash-rails
|
Lodash lodash-amd
|
| Type | Values Removed | Values Added |
|---|---|---|
| First Time appeared |
Lodash lodash-es
Lodash lodash-rails |
|
| CPEs | cpe:2.3:a:lodash:lodash-es:*:*:*:*:*:node.js:*:* cpe:2.3:a:lodash:lodash-rails:*:*:*:*:*:ruby:*:* cpe:2.3:a:lodash:lodash.template:*:*:*:*:*:node.js:*:* cpe:2.3:a:lodash:lodash:*:*:*:*:*:node.js:*:* |
|
| Vendors & Products |
Lodash lodash-es
Lodash lodash-rails |
| Type | Values Removed | Values Added |
|---|---|---|
| First Time appeared |
Lodash
Lodash lodash Lodash lodash.template |
|
| Vendors & Products |
Lodash
Lodash lodash Lodash lodash.template |
| Type | Values Removed | Values Added |
|---|---|---|
| References |
| |
| Metrics |
threat_severity
|
threat_severity
|
| Type | Values Removed | Values Added |
|---|---|---|
| Description | 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. Workarounds: Do not pass untrusted input as key names in options.imports. Only use developer-controlled, static key names. | |
| Title | lodash vulnerable to Code Injection via `_.template` imports key names | |
| Weaknesses | CWE-94 | |
| References |
| |
| Metrics |
cvssV3_1
|
View source · Bugzilla · JSON
OpenCVE enrichment
Updated: Apr 8, 2026, 8:00 PM
Debian DLA
Github GHSA
Ubuntu USN