The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-4800

CVE-2026-4800: Lodash Template RCE Vulnerability

CVE-2026-4800 is a remote code execution vulnerability in Lodash _.template that allows attackers to execute arbitrary code via untrusted options.imports key names. This post covers technical details, affected versions, and patches.

Published: April 2, 2026

CVE-2026-4800 Overview

CVE-2026-4800 is a code injection vulnerability in the Lodash JavaScript utility library affecting the _.template function. The vulnerability exists because 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, allowing attackers to inject malicious code.

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().

Critical Impact

Remote attackers can achieve arbitrary code execution during template compilation by injecting malicious payloads through untrusted options.imports key names or via prototype pollution.

Affected Products

  • Lodash versions prior to 4.18.0

Discovery Timeline

  • 2026-03-31 - CVE CVE-2026-4800 published to NVD
  • 2026-04-01 - Last updated in NVD database

Technical Details for CVE-2026-4800

Vulnerability Analysis

This vulnerability represents an incomplete fix for the previously disclosed CVE-2021-23337. While the earlier patch addressed command injection through the variable option in _.template, it failed to apply the same input validation to the options.imports key names. The core issue stems from both code paths ultimately feeding into JavaScript's Function() constructor, which dynamically compiles code from string inputs.

The vulnerability is classified as CWE-94 (Improper Control of Generation of Code - Code Injection). The attack requires network access and involves high complexity due to the prerequisite conditions, but requires no privileges or user interaction to exploit.

Root Cause

The root cause is insufficient input validation on the options.imports object key names in the _.template function. The original fix for CVE-2021-23337 focused solely on the variable option parameter, overlooking that options.imports keys also flow into the dangerous Function() constructor sink. Additionally, the use of assignInWith to merge imports introduces a secondary attack surface through prototype pollution, as it enumerates inherited properties via for..in loops.

Attack Vector

The attack can be executed remotely over the network. Attackers can exploit this vulnerability through two primary vectors:

  1. Direct Injection: When applications accept user-controlled input for options.imports key names, attackers can inject default-parameter expressions that execute during template compilation.

  2. Prototype Pollution Chain: If Object.prototype has been polluted through any other vulnerability in the application, the polluted keys are automatically copied into the imports object during the assignInWith operation and subsequently passed to Function().

javascript
 
   /** Error message constants. */
   var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
-      FUNC_ERROR_TEXT = 'Expected a function';
+      FUNC_ERROR_TEXT = 'Expected a function',
+      INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
 
   /** Used to stand-in for `undefined` hash values. */
   var HASH_UNDEFINED = '__lodash_hash_undefined__';

Source: Lodash Commit Changes

Detection Methods for CVE-2026-4800

Indicators of Compromise

  • Unusual or malformed key names in options.imports objects passed to _.template function calls
  • Unexpected code execution or process spawning originating from Node.js template compilation
  • Application logs showing template compilation errors with suspicious parameter expressions
  • Evidence of prototype pollution attempts in request bodies or query parameters

Detection Strategies

  • Implement static code analysis to identify _.template usage with dynamic options.imports key names
  • Deploy runtime application security monitoring to detect anomalous Function() constructor invocations
  • Use Software Composition Analysis (SCA) tools to identify vulnerable Lodash versions in dependencies
  • Monitor for prototype pollution patterns in incoming HTTP requests and JSON payloads

Monitoring Recommendations

  • Enable detailed logging for template compilation operations in Node.js applications
  • Implement Content Security Policy (CSP) with strict script-src directives to limit code execution
  • Deploy Web Application Firewall (WAF) rules to detect and block prototype pollution payloads
  • Monitor dependency management systems for alerts on vulnerable Lodash packages

How to Mitigate CVE-2026-4800

Immediate Actions Required

  • Upgrade Lodash to version 4.18.0 or later immediately
  • Audit codebase for all usages of _.template with dynamic options.imports parameters
  • Implement input validation to ensure only developer-controlled, static key names are used in options.imports
  • Review application for other prototype pollution vulnerabilities that could chain with this issue

Patch Information

Users should upgrade to Lodash version 4.18.0 which includes the security fix. The patch adds proper validation for options.imports key names, preventing injection of malicious expressions into the Function() constructor. For additional technical details, refer to the Lodash Commit Changes and the GitHub Security Advisory GHSA-35jh-r3h4-6jhm.

Workarounds

  • Do not pass untrusted input as key names in options.imports - only use developer-controlled, static key names
  • Implement Object freeze on Object.prototype to prevent prototype pollution chains
  • Use allowlist validation for any dynamic key names before passing to template functions
  • Consider using alternative templating libraries that do not use Function() constructor for compilation
bash
# Configuration example
# Update Lodash via npm
npm update lodash@4.18.0

# Or explicitly install the patched version
npm install lodash@4.18.0 --save

# Verify installed version
npm list lodash

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechLodash

  • SeverityHIGH

  • CVSS Score8.1

  • EPSS Probability0.07%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityHigh
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-94
  • Technical References
  • OpenJS Foundation Security Advisories

  • GitHub Security Advisory GHSA-35jh-r3h4-6jhm

  • Lodash Commit Changes
  • Related CVEs
  • CVE-2021-23337: Lodash Command Injection Vulnerability

  • CVE-2026-2950: Lodash Prototype Pollution Vulnerability

  • CVE-2025-13465: Lodash Prototype Pollution Vulnerability

  • CVE-2020-8203: Lodash Prototype Pollution Vulnerability
Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English