CVE-2026-4800 — Vulnerability in lodash-amd — CVE Details
lodash vulnerable to Code Injection via `_.template` imports key names
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (2.78%). Schedule for your next planned update.
Does your project use an affected lodash-amd version?
Paste your package-lock.json to check it for CVE-2026-4800 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Impact
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.
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.
The fix applies two changes:
- Validate
importsKeysagainst the existingreForbiddenIdentifierCharsregex (same check already used for thevariableoption) - Replace
assignInWithwithassignWithwhen merging imports, so only own properties are enumerated
Workarounds
Do not pass untrusted input as key names in options.imports. Only use developer-controlled, static key names.
Advisory Timeline
- First published April 1, 2026 (238 days ago).
- Last revised October 17, 2026 — 198 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
npm install lodash-amd@4.18.0
npm install lodash.template@4.18.0
npm install lodash@4.18.0
npm install lodash-es@4.18.0
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (4)
Affects 1 ecosystem: npm (4).
| Package | Fixed In |
|---|---|
| lodash-amd npm · Affected: All versions | 4.18.0 |
| lodash.template npm · Affected: All versions | 4.18.0 |
| lodash npm · Affected: All versions | 4.18.0 |
| lodash-es npm · Affected: All versions | 4.18.0 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-94Code InjectionMITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 8.1 score means for each attack dimension.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
References
- https://github.com/lodash/lodash/security/advisories/GHSA-r5fr-rjxr-66jcWEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-4800ADVISORY
- https://github.com/lodash/lodash/commit/3469357cff396a26c363f8c1b5a91dde28ba4b1cWEB
- https://cna.openjsf.org/security-advisories.htmlWEB
- https://github.com/advisories/GHSA-35jh-r3h4-6jhmADVISORY
- https://github.com/lodash/lodashPACKAGE
Frequently Asked Questions
- What is CVE-2026-4800?
- lodash vulnerable to Code Injection via `_.template` imports key names. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 8.1/10).
- How do I check if my project is affected by CVE-2026-4800?
- CVE-2026-4800 affects lodash-amd, lodash.template and lodash (and 1 more). It has a 2.8% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-4800 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
This places it in the top quartile of EPSS-scored vulnerabilities — 87.1% of tracked vulnerabilities score at or below it, so it is more likely to be exploited than most of the tracked corpus.
Also Known As
Related CVEs
- CVE-2019-10744CRITICAL
Prototype Pollution in lodash
- CVE-2021-23337HIGH
Command Injection in lodash
- CVE-2026-83816HIGH
CodeWhale: exec_shell parallel-readonly classifier auto-approves fd/rg/git grep exec flags enabling silent RCE
- CVE-2020-8203HIGH
Prototype Pollution in lodash
- CVE-2020-28500MEDIUM
Regular Expression Denial of Service (ReDoS) in lodash
- CVE-2026-2950MEDIUM
lodash vulnerable to prototype pollution via array-path bypass in `_.unset`, `_.omit`, and `_.pullAt
- CVE-2019-1010266MEDIUM
Regular Expression Denial of Service (ReDoS) in lodash
- CVE-2025-13465MEDIUM
Lodash has Prototype Pollution Vulnerability in `_.unset`, `_.omit`, and `_.pullAt` functions