CVE-2026-4800: lodash vulnerable to Code Injection via `_.template` imports key names
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.
Security readout for executives and security teams
Plain-English summary
CVE-2026-4800 is a high-severity lodash code-injection issue in template compilation. It matters when an application lets untrusted data control import key names for _.template, or when prototype pollution supplies inherited keys. Successful exploitation could run arbitrary code during template compilation.
Executive priority
Prioritize remediation for internet-facing or multi-tenant applications that compile lodash templates. The issue can become severe where template imports are user-influenced, but organizations should validate actual data flow before treating every lodash dependency as directly exploitable.
Technical view
The prior fix for CVE-2021-23337 validated the _.template variable option but not options.imports key names. Those keys reach the same Function() constructor sink. lodash also merges imports with assignInWith, so polluted inherited Object.prototype keys may be copied into imports and compiled.
Likely exposure
Most exposed systems are JavaScript applications using lodash, lodash-es, lodash-amd, or lodash.template 4.x with _.template and dynamic imports key names. Exposure is narrower if imports names are developer-controlled and prototype pollution is absent.
Exploitation context
The source bundle reports CVSS 8.1 with high attack complexity. KEV is false, and no provided source cites active exploitation. The attack requires a vulnerable application data flow into _.template imports keys, or separate prototype pollution reaching compilation.
Researcher notes
Focus validation on the Function() constructor path reached from _.template and imports key names. The bundle describes inherited-property copying through assignInWith, making prototype pollution an important companion condition. Avoid assuming exploitability from package presence alone.
Mitigation direction
Upgrade affected lodash packages to version 4.18.0.
Keep options.imports key names static and developer-controlled.
Do not pass user input into _.template import identifiers.
Review and remediate prototype pollution paths in the application.
Apply relevant vendor advisories, including Red Hat errata where applicable.
Validation and detection
Inventory lodash, lodash-es, lodash-amd, and lodash.template versions.
Search code for _.template usage with options.imports.
Confirm imports key names cannot come from requests, configs, or stored user data.
Check dependency lockfiles and bundled frontend assets.
Review prototype pollution findings that could affect Object.prototype before template compilation.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · medium confidence lookup
CWE-94: Code execution behavior lookup
Code execution and unsafe deserialization weaknesses often justify reviewing execution behavior and process telemetry. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
The CVE wording references code or command execution, so execution technique review may help defensive triage. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
2CVSS vectors
5Timeline events
2ADP providers
44Source links
SSVC decision data
CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: noneAutomatable: noTechnical Impact: total
CVSS vector scores
2 official scores
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.