Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
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
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • 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-2021-26119

CVE-2021-26119: Smarty Sandbox Escape Vulnerability

CVE-2021-26119 is a sandbox escape vulnerability in Smarty that allows attackers to bypass security restrictions by accessing $smarty.template_object. This article covers technical details, affected versions, and mitigation.

Published: February 25, 2026

CVE-2021-26119 Overview

CVE-2021-26119 is a Sandbox Escape vulnerability affecting the Smarty PHP template engine prior to version 3.1.39. The vulnerability allows attackers to bypass sandbox security restrictions by accessing the $smarty.template_object variable within sandbox mode, potentially leading to unauthorized template manipulation and security boundary violations.

Critical Impact

This vulnerability enables attackers to escape Smarty's sandbox protection mechanism, potentially allowing unauthorized access to template objects and bypassing intended security restrictions designed to isolate untrusted template code.

Affected Products

  • Smarty versions prior to 3.1.39
  • Debian Linux 9.0 (Stretch)
  • Debian Linux 10.0 (Buster)
  • Debian Linux 11.0 (Bullseye)

Discovery Timeline

  • 2021-02-22 - CVE-2021-26119 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2021-26119

Vulnerability Analysis

This Sandbox Escape vulnerability occurs because the Smarty template engine fails to properly restrict access to the $smarty.template_object variable when operating in sandbox mode. The sandbox feature in Smarty is designed to provide a secure environment for executing untrusted template code by limiting access to potentially dangerous PHP functions, methods, and objects. However, through this flaw, an attacker can access the internal template object, effectively breaking out of the sandbox's security boundaries.

The vulnerability allows network-based exploitation without requiring user interaction or authentication, making it particularly concerning for web applications that allow user-controlled template content. Successful exploitation can compromise the integrity of the template processing system.

Root Cause

The root cause of CVE-2021-26119 lies in insufficient access control enforcement within Smarty's sandbox implementation. The $smarty.template_object special variable was not properly restricted in sandbox mode, allowing template code to access the underlying template object instance. This object provides access to methods and properties that should be protected when operating in a restricted sandbox environment.

The security model assumes that all dangerous functionality is blocked within the sandbox, but this oversight creates a pathway for attackers to interact with internal Smarty components that were not intended to be accessible to sandboxed templates.

Attack Vector

An attacker can exploit this vulnerability through any application feature that allows user-controlled input to be processed as Smarty templates while relying on sandbox mode for security isolation. Common attack scenarios include:

The attack involves crafting malicious template code that references $smarty.template_object to gain access to the template object's methods and properties. From there, the attacker can potentially manipulate template behavior, access sensitive data, or execute operations outside the intended sandbox boundaries.

Applications that use Smarty's sandbox feature to safely process user-submitted templates are particularly vulnerable, as the sandbox is often the primary security control preventing template injection attacks from escalating to more severe impacts.

Detection Methods for CVE-2021-26119

Indicators of Compromise

  • Monitor for unusual template processing errors or exceptions related to the $smarty variable access
  • Look for templates containing references to $smarty.template_object in user-submitted content
  • Review application logs for unexpected template compilation or rendering behavior
  • Check for signs of template injection attempts in web application firewall logs

Detection Strategies

  • Implement input validation to detect and block templates referencing $smarty.template_object
  • Deploy web application firewall rules to identify sandbox escape patterns in Smarty templates
  • Monitor for anomalous behavior in template processing workflows that could indicate successful exploitation
  • Audit application code for usage of Smarty sandbox mode with untrusted template input

Monitoring Recommendations

  • Enable verbose logging for Smarty template compilation and execution
  • Set up alerts for template processing failures or security exceptions
  • Monitor system integrity for unauthorized modifications to template files or cache directories
  • Implement real-time monitoring of web application traffic for template injection patterns

How to Mitigate CVE-2021-26119

Immediate Actions Required

  • Upgrade Smarty to version 3.1.39 or later immediately
  • Review all applications using Smarty sandbox mode for potential exposure
  • Implement additional input validation for any user-controlled template content
  • Consider temporarily disabling user template features until patching is complete

Patch Information

The vulnerability has been addressed in Smarty version 3.1.39. Organizations should upgrade to this version or later to remediate the sandbox escape vulnerability. The fix properly restricts access to the $smarty.template_object variable when operating in sandbox mode.

For detailed patch information, refer to the GitHub Smarty Change Log. Linux distribution users should apply vendor-specific security updates:

  • Debian users should apply updates per Debian Security Advisory DSA-5151
  • Gentoo users should apply updates per Gentoo GLSA 2021-06

Workarounds

  • Avoid processing untrusted or user-controlled template content in Smarty sandbox mode until patched
  • Implement application-level input filtering to reject templates containing $smarty.template_object references
  • Consider using alternative template isolation mechanisms as an additional layer of defense
  • Review and restrict Smarty security policies to minimize the attack surface
bash
# Verify Smarty version and update via Composer
composer show smarty/smarty | grep versions
composer require smarty/smarty:^3.1.39

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

  • Vulnerability Details
  • TypePrivilege Escalation

  • Vendor/TechSmarty

  • SeverityHIGH

  • CVSS Score7.5

  • EPSS Probability62.61%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • NVD-CWE-noinfo
  • Technical References
  • GitHub Smarty Change Log

  • Debian LTS Announcement - April 2021

  • Debian LTS Announcement - April 2021

  • Debian Security Advisory DSA-5151
  • Vendor Resources
  • Gentoo GLSA 2021-06
  • Related CVEs
  • CVE-2024-35226: Smarty Template Engine RCE Vulnerability

  • CVE-2021-29454: Smarty Template Engine RCE Vulnerability

  • CVE-2021-26120: Smarty Template Engine RCE Vulnerability
Default Legacy - Prefooter | 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