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

> Attackers can execute arbitrary code by injecting expressions into untrusted imports key names in lodash template compilation.

- **Severity:** High 8.1 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 31 Mar 2026
- **Updated:** 15 Oct 2026
- **Also known as:** ALSA-2026:10710, ALSA-2026:10713, ALSA-2026:19167, CLEANSTART-2026-HD42236, CLEANSTART-2026-SE20608, CLSA-2026-1778805969, CLSA-2026-1791220257, DEBIAN-CVE-2026-4800, ECHO-276a-c790-4db2, GHSA-r5fr-rjxr-66jc, MINI-2f2v-hpfh-94mc, MINI-2vj8-c4xj-fpxh, MINI-364q-q43v-5mpx, MINI-3j66-rm5j-g7fq, MINI-4pj4-8f9x-m64g, MINI-4ppf-pjv2-w5q8, MINI-5733-wrwr-258r, MINI-5pqr-jr5v-4h3x, MINI-5q6p-f562-vp7r, MINI-5wjq-vr89-jr8f, MINI-69j9-qhqw-jqww, MINI-6hgh-x85q-5p43, MINI-6xmc-gqc2-xf8c, MINI-745m-hfrc-wv89, MINI-8973-96ff-wv58, MINI-9q3g-vpjv-w74g, MINI-cf3v-8g9p-ccgg, MINI-fmwq-mp8q-w74r, MINI-h6fg-5fhv-8pm3, MINI-hh6w-h2cq-7jqq, MINI-hqj9-3xhp-q9xv, MINI-hrw4-j9vg-8c78, MINI-j334-92qv-mh89, MINI-jgfq-87f3-wqgc, MINI-jm7m-r2mr-v522, MINI-jmgq-6h8c-43x7, MINI-m5w7-mf8r-68gc, MINI-pc8w-72pf-chxh, MINI-q382-6vg2-c3w3, MINI-r4pr-qww3-288w, MINI-rg6h-fgr6-4794, MINI-rvqx-v349-2h8h, MINI-vwqh-gjj4-m5hv, MINI-vx37-xgcw-3fj3, MINI-xjcg-v6ff-6wvr, MINI-xjg8-r56f-9382, MINI-xxpc-2mm9-c885, MINI-xxrq-q98h-7mq5, RHSA-2026:10710, RHSA-2026:10713, RHSA-2026:11469, RHSA-2026:11470, RHSA-2026:11471, RHSA-2026:11516, RHSA-2026:19008, RHSA-2026:19167, RLSA-2026:10710, RLSA-2026:19167, ROOT-APP-NPM-CVE-2026-4800, UBUNTU-CVE-2026-4800

## What is CVE-2026-4800?

CVE-2026-4800 is a high-severity code injection vulnerability in lodash, published on 31 Mar 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

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

Weakness: CWE-94 (Improper Control of Generation of Code)

## Which versions are affected by CVE-2026-4800?

8 open source packages ship an affected version, including lodash, lodash-amd and lodash-es. It affects 4 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `lodash` | npm | From 4.0.0 | 4.18.0 |
| `lodash` | npm | From 4.0.0 | 4.18.0 |
| `lodash-amd` | npm | From 4.0.0 | 4.18.0 |
| `lodash-amd` | npm | From 4.0.0 | 4.18.0 |
| `lodash-es` | npm | From 4.0.0 | 4.18.0 |
| `lodash-es` | npm | From 4.0.0 | 4.18.0 |
| `lodash.template` | npm | From 4.0.0 | 4.18.0 |
| `lodash.template` | npm | From 4.0.0 | 4.18.0 |
| `cockpit-ha-cluster` | AlmaLinux:10 | All versions | 0.12.1-1.el10_1.3 |
| `pcs` | AlmaLinux:9 | All versions | 0.11.10-1.el9_7.3 |
| `pcs` | AlmaLinux:9 | All versions | 0.11.11-2.el9_8.1 |
| `pcs-snmp` | AlmaLinux:9 | All versions | 0.11.10-1.el9_7.3 |
| `pcs-snmp` | AlmaLinux:9 | All versions | 0.11.11-2.el9_8.1 |
| `cockpit-ha-cluster` | Red Hat:enterprise_linux:10.1 | All versions | 0:0.12.1-1.el10_1.3 |
| `pcs` | Red Hat:enterprise_linux:10.1 | All versions | 0:0.12.1-1.el10_1.3 |
| `pcs-snmp` | Red Hat:enterprise_linux:10.1 | All versions | 0:0.12.1-1.el10_1.3 |
| `cockpit-ha-cluster` | Red Hat:enterprise_linux:10.2 | All versions | 0:0.12.2-3.el10_2.1 |
| `pcs` | Red Hat:enterprise_linux:10.2 | All versions | 0:0.12.2-3.el10_2.1 |
| `pcs-snmp` | Red Hat:enterprise_linux:10.2 | All versions | 0:0.12.2-3.el10_2.1 |
| `pcs` | Red Hat:enterprise_linux:9::highavailability | All versions | 0:0.11.10-1.el9_7.3 |
| `pcs` | Red Hat:enterprise_linux:9::highavailability | All versions | 0:0.11.11-2.el9_8.1 |
| `pcs-snmp` | Red Hat:enterprise_linux:9::highavailability | All versions | 0:0.11.10-1.el9_7.3 |
| `pcs-snmp` | Red Hat:enterprise_linux:9::highavailability | All versions | 0:0.11.11-2.el9_8.1 |
| `pcs` | Red Hat:enterprise_linux:9::resilientstorage | All versions | 0:0.11.10-1.el9_7.3 |
| `pcs` | Red Hat:enterprise_linux:9::resilientstorage | All versions | 0:0.11.11-2.el9_8.1 |
| `pcs-snmp` | Red Hat:enterprise_linux:9::resilientstorage | All versions | 0:0.11.10-1.el9_7.3 |
| `pcs-snmp` | Red Hat:enterprise_linux:9::resilientstorage | All versions | 0:0.11.11-2.el9_8.1 |
| `cockpit-ha-cluster` | Red Hat:enterprise_linux_eus:10.0 | All versions | 0:0.12.0-3.el10_0.5 |
| `pcs` | Red Hat:enterprise_linux_eus:10.0 | All versions | 0:0.12.0-3.el10_0.5 |
| `pcs-snmp` | Red Hat:enterprise_linux_eus:10.0 | All versions | 0:0.12.0-3.el10_0.5 |
| `pcs` | Red Hat:rhel_e4s:9.2::highavailability | All versions | 0:0.11.4-7.el9_2.8 |
| `pcs-snmp` | Red Hat:rhel_e4s:9.2::highavailability | All versions | 0:0.11.4-7.el9_2.8 |
| `pcs` | Red Hat:rhel_e4s:9.2::resilientstorage | All versions | 0:0.11.4-7.el9_2.8 |
| `pcs-snmp` | Red Hat:rhel_e4s:9.2::resilientstorage | All versions | 0:0.11.4-7.el9_2.8 |
| `pcs` | Red Hat:rhel_eus:9.4::highavailability | All versions | 0:0.11.7-2.el9_4.7 |
| `pcs-snmp` | Red Hat:rhel_eus:9.4::highavailability | All versions | 0:0.11.7-2.el9_4.7 |
| `pcs` | Red Hat:rhel_eus:9.4::resilientstorage | All versions | 0:0.11.7-2.el9_4.7 |
| `pcs-snmp` | Red Hat:rhel_eus:9.4::resilientstorage | All versions | 0:0.11.7-2.el9_4.7 |
| `pcs` | Red Hat:rhel_eus:9.6::highavailability | All versions | 0:0.11.9-2.el9_6.4 |
| `pcs-snmp` | Red Hat:rhel_eus:9.6::highavailability | All versions | 0:0.11.9-2.el9_6.4 |

Products: Lodash Lodash, Lodash Lodash-Amd, Lodash Lodash-Es, Lodash Lodash.template.

## How do I fix CVE-2026-4800?

Upgrade lodash to 4.18.0 or later.

## Is CVE-2026-4800 being exploited?

There is no known exploitation of CVE-2026-4800 in the wild and no public exploit code.

Public exploit code:

- https://github.com/threalwinky/CVE-2026-4800-POC (github_poc): https://github.com/threalwinky/CVE-2026-4800-POC
- https://github.com/SvenLie/next-rep-CVE-2026-4800 (github_poc): https://github.com/SvenLie/next-rep-CVE-2026-4800

## Other vulnerabilities in lodash

- [CVE-2020-8203](https://insights.sbomify.com/CVE-2020-8203/): Prototype Pollution in lodash (high 7.4)
- [CVE-2021-23337](https://insights.sbomify.com/CVE-2021-23337/): Command Injection (high 7.2)
- [CVE-2025-13465](https://insights.sbomify.com/CVE-2025-13465/): Prototype Pollution Vulnerability in Lodash _.unset and _.omit functions (medium 6.9)
- [CVE-2026-2950](https://insights.sbomify.com/CVE-2026-2950/): lodash vulnerable to Prototype Pollution via array path bypass in `_.unset` and `_.omit` (medium 6.5)
- [CVE-2019-1010266](https://insights.sbomify.com/CVE-2019-1010266/): Regular Expression Denial of Service (ReDoS) in lodash (medium 6.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-4800 and fix it if it is affected.

What it is: CVE-2026-4800 is a high-severity code injection vulnerability in lodash, published on 31 Mar 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-4800 in the wild and no public exploit code.

Affected packages and fixed versions:
- lodash (npm): affected from 4.0.0; fixed in 4.18.0
- lodash (npm): affected from 4.0.0; fixed in 4.18.0
- lodash-amd (npm): affected from 4.0.0; fixed in 4.18.0
- lodash-amd (npm): affected from 4.0.0; fixed in 4.18.0
- lodash-es (npm): affected from 4.0.0; fixed in 4.18.0
- lodash-es (npm): affected from 4.0.0; fixed in 4.18.0
- lodash.template (npm): affected from 4.0.0; fixed in 4.18.0
- lodash.template (npm): affected from 4.0.0; fixed in 4.18.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-4800/ (Markdown: https://insights.sbomify.com/CVE-2026-4800/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-4800
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-4800
- OSV: https://osv.dev/vulnerability/CVE-2026-4800

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-4800/
Summaries are generated and may contain mistakes; the official description above is the record.
