ADVISORIES

Ubuntu CVE Tracker

UBUNTU-CVE-2026-4800

Details

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

EcosystemPackageAffected versions
Ubuntu:Pro:16.04:LTSnode-lodash
All versions before 2.4.1+dfsg-3ubuntu0.1~esm1 (fixed in 2.4.1+dfsg-3ubuntu0.1~esm1)
Ubuntu:Pro:18.04:LTSnode-lodash
All versions before 4.17.4+dfsg-1ubuntu0.1~esm1 (fixed in 4.17.4+dfsg-1ubuntu0.1~esm1)
Ubuntu:Pro:20.04:LTSnode-lodash
All versions before 4.17.15+dfsg-2ubuntu0.1~esm1 (fixed in 4.17.15+dfsg-2ubuntu0.1~esm1)
Ubuntu:Pro:22.04:LTSnode-lodash
All versions before 4.17.21+dfsg+~cs8.31.198.20210220-5ubuntu0.1~esm1 (fixed in 4.17.21+dfsg+~cs8.31.198.20210220-5ubuntu0.1~esm1)
Ubuntu:Pro:24.04:LTSnode-lodash
All versions before 4.17.21+dfsg+~cs8.31.198.20210220-9ubuntu0.24.04.1~esm1 (fixed in 4.17.21+dfsg+~cs8.31.198.20210220-9ubuntu0.24.04.1~esm1)
Ubuntu:25.10node-lodash
All versions before 4.17.21+dfsg+~cs8.31.198.20210220-9ubuntu0.25.10.1 (fixed in 4.17.21+dfsg+~cs8.31.198.20210220-9ubuntu0.25.10.1)
Ubuntu:26.10node-lodash
All versions, no fix listed
Ubuntu:Pro:26.04:LTSnode-lodash
All versions before 4.17.23+dfsg-1ubuntu0.1~esm1 (fixed in 4.17.23+dfsg-1ubuntu0.1~esm1)

References