lodash vulnerable to Code Injection via `_.template` imports key names
Summary
| CVE | CVE-2026-4800 |
|---|---|
| State | PUBLISHED |
| Assigner | openjs |
| Source Priority | CVE Program / NVD first with legacy fallback |
| Published | 2026-03-31 20:16:29 UTC |
| Updated | 2026-04-01 14:23:37 UTC |
| Description | Impact: The fix for CVE-2021-23337 (https://github.com/advisories/GHSA-35jh-r3h4-6jhm) 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. Workarounds: Do not pass untrusted input as key names in options.imports. Only use developer-controlled, static key names. |
Risk And Classification
Primary CVSS: v3.1 8.1 HIGH from ce714d77-add3-4f53-aff5-83d477b104bb
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS: 0.000680000 probability, percentile 0.209680000 (date 2026-04-01)
Problem Types: CWE-94 | CWE-94 CWE-94: Improper Control of Generation of Code ('Code Injection')
| Version | Source | Type | Score | Severity | Vector |
|---|---|---|---|---|---|
| 3.1 | ce714d77-add3-4f53-aff5-83d477b104bb | Secondary | 8.1 | HIGH | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H |
| 3.1 | CNA | CVSS | 8.1 | HIGH | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H |
CVSS v3.1 Breakdown
Attack Vector
NetworkAttack Complexity
HighPrivileges Required
NoneUser Interaction
NoneScope
UnchangedConfidentiality
HighIntegrity
HighAvailability
HighCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Vendor Declared Affected Products
| Source | Vendor | Product | Version | Platforms |
|---|---|---|---|---|
| CNA | Lodash | Lodash | affected 4.0.0 4.18.0 semver | Not specified |
| CNA | Lodash | Lodash | unaffected 4.18.0 semver | Not specified |
| CNA | Lodash | Lodash-es | affected 4.0.0 4.18.0 semver | Not specified |
| CNA | Lodash | Lodash-es | unaffected 4.18.0 semver | Not specified |
| CNA | Lodash | Lodash-amd | affected 4.0.0 4.18.0 semver | Not specified |
| CNA | Lodash | Lodash-amd | unaffected 4.18.0 semver | Not specified |
| CNA | Lodash | Lodash.template | affected 4.0.0 4.18.0 semver | Not specified |
| CNA | Lodash | Lodash.template | unaffected 4.18.0 semver | Not specified |
References
| Reference | Source | Link | Tags |
|---|---|---|---|
| cna.openjsf.org/security-advisories.html | ce714d77-add3-4f53-aff5-83d477b104bb | cna.openjsf.org | |
| github.com/lodash/lodash/commit/3469357cff396a26c363f8c1b5a91dde28ba4b1c | ce714d77-add3-4f53-aff5-83d477b104bb | github.com | |
| github.com/advisories/GHSA-35jh-r3h4-6jhm | ce714d77-add3-4f53-aff5-83d477b104bb | github.com | |
| CVE Program record | CVE.ORG | www.cve.org | canonical |
| NVD vulnerability detail | NVD | nvd.nist.gov | canonical, analysis |
Vendor Comments And Credit
Discovery Credit
CNA: dolevmiz1 (en)
CNA: bugbunny-research (en)
CNA: M0nd0R (en)
CNA: UlisesGascon (en)
CNA: falsyvalues (en)
CNA: jonchurch (en)
CNA: threalwinky (en)
CNA: jdalton (en)
There are currently no legacy QID mappings associated with this CVE.