CVE-2021-23337: Command Injection
Vulnerability summary
CVE-2021-23337 is a critical (CVSS 9.8) Improper Control of Generation of Code vulnerability in lodash. EPSS estimates a 21.33% chance of exploitation in the next 30 days, higher than 97.6% of scored vulnerabilities. 6 public exploits are recorded.
Public exploit (reference, Date unknown)
Source freshness unavailable
How is this decided?Advisory lineage
Upstream 3 · Downstream 3 · Related 2Timeline
- 31-03-2026PublishedVulnerability first disclosed.
- 15-10-2026Last modifiedVulnerability information updated.
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, 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.
CVSS metrics
8 scores · 8 sources · 1 version- CVE.orgCNA8.1HighCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:HDiffers
- OSV · UbuntuEcosystem advisory · calculated9.8CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- OSV · DebianEcosystem advisory · calculated9.8CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- OSV · NpmEcosystem advisory · calculated7.2HighCVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:HDiffers
- OSV · ChainguardEcosystem advisory · calculated8.1HighCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:HDiffers
- OSV · RubygemsEcosystem advisory · calculated7.2HighCVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:HDiffers
- OSV · Red hatEcosystem advisory · calculated8.1HighCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:HDiffers
EPSS trend
Probability
21.33%
Chance of exploitation in the next 30 days
Percentile
98%
Versus all other CVEs
30-day change
No change 0.00 pp
From 21.33% on 04-10-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
6 foundExploit Reference (snyk.io)
Maturity: unknown
Exploit Reference (snyk.io)
Maturity: unknown
Exploit Reference (snyk.io)
Maturity: unknown
Weaknesses
CWE · root causeAffected systems
Known conditions: network-reachable, no authentication, no user interaction (CVSS vector). Other conditions: not stated in public data.
Chainguard148 products
- airflow-2All versions (No fix recorded)
- airflow-core-2All versions (No fix recorded)
- arangodb-3.11< 3.11.14.3-r5
- arangodb-3.12< 3.12.7.2-r5
- argo-workflows-ui-3.6< 3.6.19-r5
Wolfi36 products
- argo-workflows-ui-3.7< 3.7.13-r0
- argo-workflows-ui-4.0< 4.0.4-r0
- code-server< 4.112.0-r2
- jitsucom-jitsu-console< 2.11.0-r19
- json-server< 0.17.4-r6
Npm5 products
- lodash≥ 4.0.0, < 4.18.0 | < 4.17.21
- lodash-amd≥ 4.0.0, < 4.18.0
- lodash-es≥ 4.0.0, < 4.18.0 | < 4.17.21
- lodash-template≤ 1.0.0
- lodash.template≥ 4.0.0, < 4.18.0 | ≤ 4.5.0
Lodash4 products
- lodash< 4.17.21 | ≥ 4.0.0, < 4.18.1 | ≥ 4.0.0, < 4.18.0
- lodash-amd≥ 4.0.0, < 4.18.1 | ≥ 4.0.0, < 4.18.0
- lodash-es≥ 4.0.0, < 4.18.1 | ≥ 4.0.0, < 4.18.0
- lodash.template≥ 4.0.0, < 4.18.1 | ≥ 4.0.0, < 4.18.0
Netapp3 products
Debian1 product
- node-lodash< 4.17.21+dfsg+~cs8.31.173-1 | < 4.17.21+dfsg+~cs8.31.198.20210220-9+deb12u1 | < 4.17.21+dfsg+~cs8.31.198.20210220-9+deb13u1 | < 4.18.1+dfsg-1
Oracle1 product
- banking_corporate_lending_process_management14.2.0 | 14.3.0 | 14.5.0
RubyGems1 product
- lodash-rails< 4.17.21
Ubuntu1 product
- node-lodash< 2.4.1+dfsg-3ubuntu0.1~esm1 | < 4.17.4+dfsg-1ubuntu0.1~esm1 | < 4.17.15+dfsg-2ubuntu0.1~esm1 | < 4.17.21+dfsg+~cs8.31.198.20210220-5ubuntu0.1~esm1 | < 4.17.21+dfsg+~cs8.31.198.20210220-9ubuntu0.24.04.1~esm1 | < 4.17.21+dfsg+~cs8.31.198.20210220-9ubuntu0.25.10.1 | All versions (No fix recorded) | < 4.17.23+dfsg-1ubuntu0.1~esm1
9 vendors · 200 products · Showing 200 of 231
References
129 links- snyk.io/vuln/SNYK-JAVA-ORGWEBJARSBOWER-1074928X Refsource MISCREPORTWEBEVIDENCEExploitThird Party Advisory
- snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-1074929X Refsource MISCREPORTWEBEVIDENCEExploitThird Party Advisory
- snyk.io/vuln/SNYK-JAVA-ORGWEBJARS-1074930X Refsource MISCREPORTWEBEVIDENCEExploitThird Party Advisory
- snyk.io/vuln/SNYK-JAVA-ORGWEBJARSBOWERGITHUBLODASH-1074931X Refsource MISCREPORTWEBEVIDENCEExploitThird Party Advisory
- snyk.io/vuln/SNYK-JAVA-ORGFUJIONWEBJARS-1074932X Refsource MISCREPORTWEBEVIDENCEExploitThird Party Advisory
- github.com/lodash/lodash/blob/ddfd9b11a0126db2302cb70ec9973b66baec0975/lodash.js%23L14851X Refsource MISCREPORTWEBBroken Link
Show all 100 references
- cert-portal.siemens.com/productcert/pdf/ssa-637483.pdfX Refsource CONFIRMWEBFIXPatchThird Party Advisory
- github.com/lodash/lodash/commit/3469357cff396a26c363f8c1b5a91dde28ba4b1cWEBFIXNot ApplicableARTICLEREPORT
- github.com/lodash/lodashPACKAGE
Showing 100 of 129.