Skip to main content

CVE-2026-4800 — Vulnerability in lodash-amd — CVE Details

HIGH

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

Published April 1, 2026Updated October 17, 2026Source: OSV

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.

Check my package-lock.json

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:

  1. Validate importsKeys against the existing reForbiddenIdentifierChars regex (same check already used for the variable option)
  2. Replace assignInWith with assignWith when 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
Update lodash-amd to 4.18.0 or later
npm install lodash-amd@4.18.0
npm
Update lodash.template to 4.18.0 or later
npm install lodash.template@4.18.0
npm
Update lodash to 4.18.0 or later
npm install lodash@4.18.0
npm
Update lodash-es to 4.18.0 or later
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).

PackageFixed In
lodash-amd npm · Affected: All versions4.18.0
lodash.template npm · Affected: All versions4.18.0
lodash npm · Affected: All versions4.18.0
lodash-es npm · Affected: All versions4.18.0

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 8.1 score means for each attack dimension.

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

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

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

CVSS Score
8.1

Significant impact if exploited, or exploitable with modest effort.

EPSS Score (30-day exploit probability)
2.78%
EPSS percentile: 87.1

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

GHSA-r5fr-rjxr-66jc

Related CVEs

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my package-lock.json