CVE-2026-4800

NameCVE-2026-4800
DescriptionThe 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.
SourceCVE (at NVD; CERT, ENISA, LWN, oss-sec, fulldisc, Debian ELTS, Red Hat, Ubuntu, Gentoo, SUSE bugzilla/CVE, GitHub advisories/code/issues, web search, more)
ReferencesDLA-4663-1, DLA-4820-1
Debian Bugs1132500

Vulnerable and fixed packages

The table below lists information on source packages.

Source PackageReleaseVersionStatus
node-lodash (PTS)bookworm4.17.21+dfsg+~cs8.31.198.20210220-9vulnerable
bookworm (security)4.17.21+dfsg+~cs8.31.198.20210220-9+deb12u1fixed
trixie4.17.21+dfsg+~cs8.31.198.20210220-9+deb13u1fixed
forky, sid4.18.1+dfsg1-2fixed

The information below is based on the following data on fixed versions.

PackageTypeReleaseFixed VersionUrgencyOriginDebian Bugs
node-lodashsourcebullseye4.17.21+dfsg+~cs8.31.173-1+deb11u1DLA-4663-1
node-lodashsourcebookworm4.17.21+dfsg+~cs8.31.198.20210220-9+deb12u1DLA-4820-1
node-lodashsourcetrixie4.17.21+dfsg+~cs8.31.198.20210220-9+deb13u1
node-lodashsource(unstable)4.18.1+dfsg-11132500

Notes

Fixed by: https://github.com/lodash/lodash/commit/879aaa93132d78c2f8d20c60279da9f8b21576d6 (4.18.0)
Followup for tests: https://github.com/lodash/lodash/commit/af634573030f979194871da7c68f79420992f53d (4.18.0)

Search for package or bug name: Reporting problems