npm
CVE-2026-4800
lodash vulnerable to Code Injection via `_.template` imports key names
- Severity
- High 8.1
- Published
- 1 Apr 2026
- Last changed
- 17 Oct 2026
- Added to UpHeron
- 10 Nov 2026
- Fixed in
- 4.18.0
- Exploit chance
- 2.9% in the next 30 daysHigher than 87% of CVEs. EPSS by FIRST, 19 Nov 2026
- Weakness
- Code injection (CWE-94)
- Attack
- Over the network · Only under certain conditions · No login needed · No user action needed
- Attacker can
- Read data · Change data · Take it down
- CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H- Also known as
- GHSA-r5fr-rjxr-66jc
- Sources
- OSV.dev and GitHub
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. 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().
Workarounds
Do not pass untrusted input as key names in options.imports. Only use developer-controlled, static key names.
Affected software
| Software | Affected versions |
|---|---|
lodashnpm · osv:npm:lodash |
|
lodash-amdnpm · osv:npm:lodash-amd |
|
lodash-esnpm · osv:npm:lodash-es |
|
lodash.templatenpm · osv:npm:lodash.template |
|
About lodash
- Weekly downloads (npm)
- 205,327,931npm, 18 Nov 2026
Vulnerabilities in lodash
- In our list
- 2
- Published in the last 12 months
- 2
- Critical, last 12 months
- 0
- High, last 12 months
- 1
- Known exploited
- 0
- CVE-2025-13465Lodash has Prototype Pollution Vulnerability in `_.unset`, `_.omit`, and `_.pullAt` functionsMedium 6.5 21 Jan 2026
About lodash-amd
- Weekly downloads (npm)
- 6,591npm, 18 Nov 2026
Vulnerabilities in lodash-amd
- In our list
- 2
- Published in the last 12 months
- 2
- Critical, last 12 months
- 0
- High, last 12 months
- 1
- Known exploited
- 0
- CVE-2025-13465Lodash has Prototype Pollution Vulnerability in `_.unset`, `_.omit`, and `_.pullAt` functionsMedium 6.5 21 Jan 2026
About lodash-es
- Weekly downloads (npm)
- 71,083,440npm, 18 Nov 2026
Vulnerabilities in lodash-es
- In our list
- 2
- Published in the last 12 months
- 2
- Critical, last 12 months
- 0
- High, last 12 months
- 1
- Known exploited
- 0
- CVE-2025-13465Lodash has Prototype Pollution Vulnerability in `_.unset`, `_.omit`, and `_.pullAt` functionsMedium 6.5 21 Jan 2026
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-4800
- GitHub Advisory Database https://github.com/advisories/GHSA-r5fr-rjxr-66jc