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

Summary

CVECVE-2026-4800
StatePUBLISHED
Assigneropenjs
Source PriorityCVE Program / NVD first with legacy fallback
Published2026-03-31 20:16:29 UTC
Updated2026-04-07 15:43:13 UTC
DescriptionImpact: 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.

Risk And Classification

Primary CVSS: v3.1 9.8 CRITICAL from [email protected]

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

EPSS: 0.000890000 probability, percentile 0.253390000 (date 2026-04-07)

Problem Types: CWE-94 | CWE-94 CWE-94: Improper Control of Generation of Code ('Code Injection')


VersionSourceTypeScoreSeverityVector
3.1[email protected]Primary9.8CRITICALCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
3.1ce714d77-add3-4f53-aff5-83d477b104bbSecondary8.1HIGHCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
3.1CNACVSS8.1HIGHCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

CVSS v3.1 Breakdown

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

NVD Known Affected Configurations (CPE 2.3)

TypeVendorProductVersionUpdateEditionLanguage
Application Lodash Lodash All All All All
Application Lodash Lodash-es All All All All
Application Lodash Lodash-rails All All All All
Application Lodash Lodash.template All All All All

Vendor Declared Affected Products

SourceVendorProductVersionPlatforms
CNA Lodash Lodash affected 4.0.0 4.18.0 semver Not specified
CNA Lodash Lodash unaffected 4.18.0 semver Not specified
CNA Lodash Lodash-es affected 4.0.0 4.18.0 semver Not specified
CNA Lodash Lodash-es unaffected 4.18.0 semver Not specified
CNA Lodash Lodash-amd affected 4.0.0 4.18.0 semver Not specified
CNA Lodash Lodash-amd unaffected 4.18.0 semver Not specified
CNA Lodash Lodash.template affected 4.0.0 4.18.0 semver Not specified
CNA Lodash Lodash.template unaffected 4.18.0 semver Not specified

References

ReferenceSourceLinkTags
cna.openjsf.org/security-advisories.html ce714d77-add3-4f53-aff5-83d477b104bb cna.openjsf.org Third Party Advisory
github.com/lodash/lodash/commit/3469357cff396a26c363f8c1b5a91dde28ba4b1c ce714d77-add3-4f53-aff5-83d477b104bb github.com Patch
github.com/advisories/GHSA-35jh-r3h4-6jhm ce714d77-add3-4f53-aff5-83d477b104bb github.com Third Party Advisory
CVE Program record CVE.ORG www.cve.org canonical
NVD vulnerability detail NVD nvd.nist.gov canonical, analysis

Vendor Comments And Credit

Discovery Credit

CNA: dolevmiz1 (en)

CNA: bugbunny-research (en)

CNA: M0nd0R (en)

CNA: UlisesGascon (en)

CNA: falsyvalues (en)

CNA: jonchurch (en)

CNA: threalwinky (en)

CNA: jdalton (en)

© CVE.report 2026 |

Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. It is the responsibility of user to evaluate the accuracy, completeness or usefulness of any information, opinion, advice or other content. EACH USER WILL BE SOLELY RESPONSIBLE FOR ANY consequences of his or her direct or indirect use of this web site. ALL WARRANTIES OF ANY KIND ARE EXPRESSLY DISCLAIMED. This site will NOT BE LIABLE FOR ANY DIRECT, INDIRECT or any other kind of loss.

CVE, CWE, and OVAL are registred trademarks of The MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. This site includes MITRE data granted under the following license.

Free CVE JSON API cve.report/api

CVE.report and Source URL Uptime Status status.cve.report