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-2022-23614

CVE-2022-23614: Symfony Twig Sandbox RCE Vulnerability

CVE-2022-23614 is a remote code execution flaw in Symfony Twig that allows attackers to bypass sandbox restrictions and execute arbitrary PHP code. This article covers technical details, affected versions, and mitigation.

Published: February 18, 2026

CVE-2022-23614 Overview

CVE-2022-23614 is a code injection vulnerability in Symfony Twig, an open source template language for PHP. When Twig operates in sandbox mode, the arrow parameter of the sort filter must be a closure to prevent attackers from executing arbitrary PHP functions. In affected versions, this constraint was not properly enforced, allowing attackers to inject and execute arbitrary PHP code by passing non-closure callables to the sort filter.

Critical Impact

Successful exploitation allows remote attackers to execute arbitrary PHP code on vulnerable systems without authentication, potentially leading to complete system compromise, data theft, and lateral movement within the network.

Affected Products

  • Symfony Twig (versions prior to patched releases)
  • Fedora 34 and Fedora 35
  • Debian Linux 11.0

Discovery Timeline

  • 2022-02-04 - CVE-2022-23614 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2022-23614

Vulnerability Analysis

The vulnerability exists in Twig's sandbox security mechanism, which is designed to safely execute untrusted templates by restricting access to dangerous PHP functions and objects. The sort filter accepts an optional arrow parameter that allows custom sorting logic through a callback function. In secure configurations, this parameter should only accept closures (anonymous functions) to prevent attackers from specifying arbitrary PHP functions as callbacks.

The flaw occurred because the sort filter implementation did not validate that the arrow parameter was specifically a Closure object. This allowed attackers to pass string-based callable references (such as 'system', 'exec', or other dangerous PHP functions) as the sorting callback, effectively bypassing the sandbox restrictions entirely.

Root Cause

The root cause lies in the insufficient type checking within the twig_sort_filter function in src/Extension/CoreExtension.php. The filter was registered without the needs_environment flag and lacked validation to ensure the callback parameter was a Closure when sandbox mode was enabled. This architectural oversight allowed arbitrary callable types to be processed, defeating the purpose of the sandbox security model.

Attack Vector

An attacker with the ability to control or inject Twig template content can exploit this vulnerability by crafting a malicious sort filter call that passes an arbitrary PHP function name as the arrow parameter. Since the sandbox mode fails to enforce the Closure requirement, the attacker's specified function executes with the template engine's privileges. The attack requires network access and no user interaction, making it highly exploitable in web application contexts where user-supplied template content is processed.

php
// Security patch in src/Extension/CoreExtension.php
// Before the fix, the sort filter did not require environment access
             // array helpers
             new TwigFilter('join', 'twig_join_filter'),
             new TwigFilter('split', 'twig_split_filter', ['needs_environment' => true]),
-            new TwigFilter('sort', 'twig_sort_filter'),
+            new TwigFilter('sort', 'twig_sort_filter', ['needs_environment' => true]),
             new TwigFilter('merge', 'twig_array_merge'),
             new TwigFilter('batch', 'twig_array_batch'),
             new TwigFilter('column', 'twig_array_column'),

Source: GitHub Commit

Detection Methods for CVE-2022-23614

Indicators of Compromise

  • Unusual PHP function calls originating from Twig template rendering processes
  • Web application logs showing sort filter usage with suspicious callback parameters
  • Unexpected system command execution or file system access from PHP processes
  • Network connections or data exfiltration originating from web server processes

Detection Strategies

  • Monitor PHP application logs for template parsing errors or unexpected function call patterns
  • Implement web application firewalls (WAF) with rules to detect malicious Twig template syntax
  • Review application code for instances where user-controlled input reaches Twig template rendering
  • Deploy runtime application self-protection (RASP) solutions to detect code injection attempts

Monitoring Recommendations

  • Enable verbose logging for Twig template compilation and execution processes
  • Configure alerting for PHP error logs indicating sandbox policy violations
  • Monitor for unexpected child processes spawned by PHP-FPM or web server workers
  • Implement file integrity monitoring on web application directories

How to Mitigate CVE-2022-23614

Immediate Actions Required

  • Upgrade Symfony Twig to version 2.14.11 or later immediately
  • Review application code to identify all Twig sandbox implementations
  • Audit template sources to ensure no untrusted content can be rendered
  • Apply vendor-provided security patches from Fedora or Debian if applicable

Patch Information

Symfony has released security patches that enforce Closure validation for the arrow parameter in the sort filter when sandbox mode is enabled. The fix modifies the sort filter registration to include the needs_environment flag, enabling proper security checks. Patches are available through the official GitHub Security Advisory and distribution-specific advisories including Debian Security Advisory DSA-5107.

Workarounds

  • Disable sandbox mode entirely if user-controlled template content is not required
  • Implement strict input validation to prevent untrusted content from reaching template rendering
  • Use a web application firewall to block requests containing suspicious Twig filter syntax
  • Consider implementing content security policies to restrict template sources
bash
# Update Twig via Composer to the patched version
composer require twig/twig:^2.14.11

# For Debian-based systems, apply the security update
apt-get update && apt-get install --only-upgrade php-twig

# For Fedora systems
dnf update php-twig

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechSymfony

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability34.90%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-74

  • CWE-94
  • Technical References
  • GitHub Security Advisory

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Debian Security Advisory
  • Vendor Resources
  • GitHub Commit Update

  • GitHub Commit Update
  • Related CVEs
  • CVE-2024-50340: Symfony Runtime RCE Vulnerability

  • CVE-2026-24739: Symfony Path Traversal Vulnerability

  • CVE-2024-50345: Symfony HTTP Foundation URI 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