Vulnerability · Published Mar 31, 2026 · Assigned by openjs

CVE-2026-4800lodash vulnerable to Code Injection via `_.template` imports key names

High 8.1

In plain English

A high-severity code injection in lodash from lodash. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 2.8% (higher than 87% of all known vulnerabilities). Ready-made attack tooling exists: public proof-of-concept code. Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)8.1High
Exploit odds (30 days)2.8%top 13.4% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack tooling1Public PoC

Official 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.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
AlmaLinux:10cockpit-ha-cluster0.12.1-1.el10_1.3ALSA-2026:10713
AlmaLinux:9pcs0.11.10-1.el9_7.3ALSA-2026:10710
AlmaLinux:9pcs0.11.11-2.el9_8.1ALSA-2026:19167
AlmaLinux:9pcs-snmp0.11.10-1.el9_7.3ALSA-2026:10710
AlmaLinux:9pcs-snmp0.11.11-2.el9_8.1ALSA-2026:19167
Debian:12node-lodash4.17.21+dfsg+~cs8.31.198.20210220-9+deb12u1DEBIAN-CVE-2026-4800
Debian:13node-lodash4.17.21+dfsg+~cs8.31.198.20210220-9+deb13u1DEBIAN-CVE-2026-4800
Debian:14node-lodash4.18.1+dfsg-1DEBIAN-CVE-2026-4800
Rocky Linux:10cockpit-image-builder0:94.3-1.el10_2RLSA-2026:24331
Rocky Linux:9pcs0:0.11.11-2.el9_8.1RLSA-2026:19167
Rocky Linux:9pcs0:0.11.10-1.el9_7.3RLSA-2026:10710
Ubuntu:25.10node-lodash4.17.21+dfsg+~cs8.31.198.20210220-9ubuntu0.25.10.1USN-8411-1
Ubuntu:25.10node-lodash4.17.21+dfsg+~cs8.31.198.20210220-9ubuntu0.25.10.1UBUNTU-CVE-2026-4800
Ubuntu:26.10node-lodashno fix listedUBUNTU-CVE-2026-4800
npmlodash4.18.0GHSA-r5fr-rjxr-66jc
npmlodash-amd4.18.0GHSA-r5fr-rjxr-66jc
npmlodash-es4.18.0GHSA-r5fr-rjxr-66jc
npmlodash.template4.18.0GHSA-r5fr-rjxr-66jc

Affected products (as reported)

VendorProductVersions
lodash lodash 4.0.0 – before 4.18.1
lodash lodash-es 4.0.0 – before 4.18.1
lodash lodash-amd 4.0.0 – before 4.18.1
lodash lodash.template 4.0.0 – before 4.18.1

Weakness: CWE-94 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

References