Security mailing lists by PureSourceCode

CVE-2026-4800

CRITICAL 9.8CVSS 3.1

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

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.

Published
31 Mar 2026
Last modified
17 Oct 2026
Assigned by
ce714d77-add3-4f53-aff5-83d477b104bb
NVD status
Modified
Weakness
CWE-94
Also known as
GHSA-r5fr-rjxr-66jc
Sources
NVDJSONOSV GHSA-r5fr-rjxr-66jcJSON

Scores

SourceScored byVersionScoreVector / decision
NVD nvd@nist.gov (Primary) CVSS 3.1 CRITICAL 9.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD ce714d77-add3-4f53-aff5-83d477b104bb (Secondary) CVSS 3.1 HIGH 8.1 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD 0b0ca135-0b70-47e7-9f44-1890c2a1c46c (Secondary) CVSS 3.1 HIGH 8.1 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
OSV GitHub CVSS 3.1 HIGH 8.1 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

Affected

SourceVendor / ecosystemProduct / packageAffected versionsFixed in
NVD lodash lodash
cpe:2.3:a:lodash:lodash:*:*:*:*:*:node.js:*:*
>= 4.0.0, < 4.18.0 4.18.0
NVD lodash lodash-amd
cpe:2.3:a:lodash:lodash-amd:*:*:*:*:*:node.js:*:*
>= 4.0.0, < 4.18.0 4.18.0
NVD lodash lodash-es
cpe:2.3:a:lodash:lodash-es:*:*:*:*:*:node.js:*:*
>= 4.0.0, < 4.18.0 4.18.0
NVD lodash lodash.template
cpe:2.3:a:lodash:lodash.template:*:*:*:*:*:node.js:*:*
>= 4.0.0, < 4.18.0 4.18.0
OSV npm lodash >= 4.0.0, < 4.18.0 4.18.0
OSV npm lodash-es >= 4.0.0, < 4.18.0 4.18.0
OSV npm lodash-amd >= 4.0.0, < 4.18.0 4.18.0
OSV npm lodash.template >= 4.0.0, < 4.18.0 4.18.0

References

History

  • 25 Nov 2026 21:02 UTC · NVD: first stored (published 31 Mar 2026)
  • 25 Nov 2026 20:11 UTC · OSV: first stored (published 1 Apr 2026)
An unhandled error has occurred. Reload ×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.