A Leader in the 2025 Gartner® Magic Quadrant™ for Endpoint Protection Platforms. Five years running.A Leader in the Gartner® Magic Quadrant™Read the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI Security Portfolio
      Leading the Way in AI-Powered Security Solutions
    • 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
    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
    Identity Security
    • Singularity Identity
      Identity Threat Detection and Response
  • 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
      Digital Forensics, IRR & Breach Readiness
    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
    • 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-2025-46731

CVE-2025-46731: Craft CMS Twig SSTI RCE Vulnerability

CVE-2025-46731 is a remote code execution vulnerability in Craft CMS caused by Twig Server-Side Template Injection. Attackers with admin access can exploit this flaw to execute arbitrary code on affected systems.

Updated: January 22, 2026

CVE-2025-46731 Overview

CVE-2025-46731 is a Remote Code Execution (RCE) vulnerability affecting Craft CMS, a popular content management system. The vulnerability exists due to improper handling of Server-Side Template Injection (SSTI) in the Twig templating engine. This flaw allows authenticated administrators to execute arbitrary code on the server when the ALLOW_ADMIN_CHANGES configuration option is enabled.

Critical Impact

Authenticated administrators can achieve remote code execution on affected Craft CMS installations when ALLOW_ADMIN_CHANGES is enabled, potentially leading to complete server compromise.

Affected Products

  • Craft CMS 4.x versions prior to 4.14.13
  • Craft CMS 5.x versions prior to 5.6.16
  • Craft CMS release candidates including 4.0.0-rc1, 4.0.0-rc2, 4.0.0-rc3, and 5.0.0-rc1

Discovery Timeline

  • 2025-05-05 - CVE-2025-46731 published to NVD
  • 2025-09-03 - Last updated in NVD database

Technical Details for CVE-2025-46731

Vulnerability Analysis

This vulnerability stems from Server-Side Template Injection (SSTI) in Craft CMS's implementation of the Twig templating engine. Twig is a flexible, fast, and secure template engine for PHP that is widely used in web applications. When user-controlled input is improperly handled within Twig templates, it can lead to arbitrary code execution on the server.

The vulnerability requires two preconditions for successful exploitation: the attacker must have administrator-level access to the Craft CMS installation, and the ALLOW_ADMIN_CHANGES configuration setting must be enabled. While this limits the attack surface to privileged users, it represents a significant risk in environments where administrator accounts may be compromised or where insider threats exist.

Root Cause

The root cause is categorized under CWE-1336 (Improper Neutralization of Special Elements Used in a Template Engine). Craft CMS failed to properly sanitize or restrict template expressions that could be manipulated by administrators through the CMS interface. This allows specially crafted Twig template syntax to break out of the intended template context and execute arbitrary PHP code on the underlying server.

Attack Vector

The attack is network-based and requires authentication with administrator privileges. An attacker with valid administrator credentials can inject malicious Twig template syntax through various CMS features that process template content. When the ALLOW_ADMIN_CHANGES configuration is set to true (which is common in development and staging environments), the injected template code is processed by the Twig engine, leading to server-side code execution.

The exploitation mechanism involves crafting Twig template syntax that leverages built-in functions or filters to access PHP functionality. Since Twig provides various ways to interact with the underlying PHP environment, a sufficiently creative payload can achieve full remote code execution. For detailed technical information about the vulnerability mechanism, refer to the GitHub Security Advisory.

Detection Methods for CVE-2025-46731

Indicators of Compromise

  • Unusual or unexpected Twig template syntax in CMS content fields, especially containing PHP function calls or system commands
  • Administrator account activity logs showing template modifications with suspicious payloads
  • Web server logs containing requests with encoded or obfuscated Twig template injection patterns
  • Unexpected process spawning or outbound network connections from the web server process

Detection Strategies

  • Monitor Craft CMS audit logs for template modifications by administrator accounts, particularly looking for Twig syntax containing filters like |filter or functions accessing system resources
  • Implement Web Application Firewall (WAF) rules to detect common SSTI patterns in HTTP requests targeting Craft CMS endpoints
  • Review access logs for unusual POST requests to administrative endpoints that handle template content
  • Deploy runtime application self-protection (RASP) solutions to detect template injection attempts

Monitoring Recommendations

  • Enable comprehensive logging for all administrator actions within Craft CMS and forward logs to a SIEM solution
  • Configure alerting for any changes to the ALLOW_ADMIN_CHANGES configuration setting
  • Implement file integrity monitoring on Craft CMS template directories to detect unauthorized modifications
  • Regularly audit administrator accounts and enforce multi-factor authentication to reduce the risk of credential compromise

How to Mitigate CVE-2025-46731

Immediate Actions Required

  • Update Craft CMS to version 4.14.13 or 5.6.16 immediately depending on your installed branch
  • Set ALLOW_ADMIN_CHANGES to false in production environments as recommended in the Craft CMS Security Guide
  • Audit all administrator accounts and remove any unnecessary privileged access
  • Review recent administrator activity logs for any suspicious template modifications

Patch Information

Craft CMS has released patched versions that address this vulnerability. Users on the 4.x branch should upgrade to version 4.14.13 or later. Users on the 5.x branch should upgrade to version 5.6.16 or later. The patch details are available in the GitHub Pull Request #17026.

Workarounds

  • Disable ALLOW_ADMIN_CHANGES by setting it to false in your environment configuration, which prevents the vulnerable functionality from being accessible
  • Implement strict access controls to limit administrator account access to only essential personnel
  • Use a staging environment for all template changes and deploy to production through a controlled CI/CD pipeline rather than direct admin access
  • Consider implementing additional network segmentation to restrict access to the Craft CMS administrative interface
bash
# Configuration example - Add to your .env file or config/general.php
# Disable admin changes in production to mitigate this vulnerability
ALLOW_ADMIN_CHANGES=false

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechCraft Cms

  • SeverityHIGH

  • CVSS Score7.3

  • EPSS Probability0.26%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:P/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-1336
  • Technical References
  • Craft CMS Security Guide

  • GitHub Security Advisory

  • GitHub Security Advisory
  • Vendor Resources
  • GitHub Pull Request
  • Related CVEs
  • CVE-2025-35939

  • CVE-2025-32432

  • CVE-2025-23209

  • CVE-2024-56145
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
  • English
  • 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