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-2024-35226

CVE-2024-35226: Smarty Template Engine RCE Vulnerability

CVE-2024-35226 is a remote code execution flaw in Smarty template engine for PHP that allows template authors to inject malicious code via extends-tag filenames. This article covers technical details, affected versions, impact, and mitigation.

Updated: January 22, 2026

CVE-2024-35226 Overview

CVE-2024-35226 is a code injection vulnerability in Smarty, a widely-used template engine for PHP that facilitates the separation of presentation (HTML/CSS) from application logic. In affected versions, template authors could inject PHP code by choosing a malicious file name for an extends tag, allowing arbitrary code execution within the context of the PHP application.

Critical Impact

Template authors with the ability to create or modify templates can achieve arbitrary PHP code execution, potentially compromising the entire web application and underlying server. Sites that cannot fully trust template authors are at significant risk.

Affected Products

  • Smarty Template Engine (versions prior to security patch)
  • PHP applications utilizing vulnerable Smarty versions
  • Content management systems and frameworks built on Smarty

Discovery Timeline

  • 2024-05-28 - CVE CVE-2024-35226 published to NVD
  • 2025-11-03 - Last updated in NVD database

Technical Details for CVE-2024-35226

Vulnerability Analysis

This vulnerability is classified as CWE-94 (Improper Control of Generation of Code - Code Injection). The flaw exists in Smarty's handling of the extends tag, which is used for template inheritance. When processing an extends directive, Smarty fails to properly validate and sanitize the file name parameter, creating an injection point for malicious PHP code.

The attack requires an authenticated user with template authoring privileges, and some user interaction is involved in the exploitation chain. Upon successful exploitation, attackers can achieve both high confidentiality and integrity impact, potentially reading sensitive data and modifying application behavior, though availability is not directly impacted.

Root Cause

The root cause lies in insufficient input validation within Smarty's template parsing mechanism. When the extends tag processes a file name, it does not adequately sanitize special characters or validate the input against expected patterns. This allows specially crafted file names to break out of the intended context and inject executable PHP code into the template compilation process.

Attack Vector

The attack vector is network-based and requires low complexity to execute. An attacker with template authoring privileges can craft a malicious template file containing an extends tag with a specially formatted file name. When Smarty processes this template, the malicious payload embedded in the file name is executed as PHP code.

The vulnerability mechanism involves the extends tag file name parameter being improperly handled during template compilation. When a template author specifies a malicious file name pattern, the parser fails to properly escape or validate the input, allowing PHP code to be injected and subsequently executed. For detailed technical information, refer to the GitHub Security Advisory.

Detection Methods for CVE-2024-35226

Indicators of Compromise

  • Unexpected PHP errors or exceptions related to template processing or extends tag evaluation
  • Unusual file access patterns in template directories, particularly files with suspicious naming conventions
  • Web server logs showing template compilation errors followed by unauthorized actions
  • New or modified template files containing unusual extends tag syntax

Detection Strategies

  • Implement file integrity monitoring on template directories to detect unauthorized modifications
  • Review template files for suspicious extends tag patterns containing special characters or encoded sequences
  • Monitor PHP error logs for Smarty-related exceptions that may indicate exploitation attempts
  • Audit template authoring permissions and review which users have write access to template files

Monitoring Recommendations

  • Enable verbose logging for Smarty template compilation events
  • Configure intrusion detection systems to alert on PHP code execution patterns originating from template directories
  • Implement real-time alerting for new template file creation or modification by non-administrative users
  • Monitor outbound network connections from web servers that may indicate post-exploitation activity

How to Mitigate CVE-2024-35226

Immediate Actions Required

  • Update Smarty to the latest patched version immediately using the commit referenced in the security advisory
  • Audit all existing templates for potentially malicious extends tag usage
  • Restrict template authoring privileges to only fully trusted users
  • Consider implementing a template review workflow for any template changes

Patch Information

The vulnerability has been addressed in an official security patch. The fix is available in commit 0be92bc8a6fb83e6e0d883946f7e7c09ba4e857a. Users should update to the latest Smarty version that includes this patch. For detailed patch information, see the GitHub Commit. Debian users should also review the Debian LTS Announcement for distribution-specific guidance.

Important: There is no patch available for users on the v3 branch. Users on this branch should consider upgrading to a newer major version.

Workarounds

  • There are no known workarounds for this vulnerability according to the security advisory
  • As a risk reduction measure, limit template authoring access to only fully trusted personnel
  • Consider implementing a sandboxed template environment with restricted PHP functions if possible
  • Review and harden file system permissions on template directories to prevent unauthorized modifications
bash
# Update Smarty via Composer to get the latest security patch
composer update smarty/smarty

# Verify installed version after update
composer show smarty/smarty | grep versions

# Audit template files for suspicious extends tag patterns
grep -r "{extends" /path/to/templates/ | grep -E "['\"].*[^a-zA-Z0-9_\-\./]"

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechSmarty

  • SeverityHIGH

  • CVSS Score7.3

  • EPSS Probability0.13%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityHigh
  • AvailabilityNone
  • CWE References
  • CWE-94
  • Technical References
  • GitHub Commit Update

  • GitHub Security Advisory

  • Debian LTS Announcement
  • Related CVEs
  • CVE-2021-29454: Smarty Template Engine RCE Vulnerability

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

  • CVE-2021-26119: Smarty Sandbox Escape 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