Craft CMS: Authenticated RCE through Twig sandbox escape (CVE-2026-72781)
Craft CMS contains an authenticated remote code execution (RCE) vulnerability via the Twig sandbox escape mechanism. The vulnerability arises because the Twig sandbox's allowlisting permits dangerous functionality from the Yii framework, specifically through a function-call gadget in yii\base\Component. An authenticated user with control panel access can exploit this by rendering a malicious Twig template, bypassing sandbox protections. This affects Craft CMS versions from 4.0.0-RC1 up to but not including 4.18.3, and 5.0.0-RC1 up to but not including 5.10.7. A patch is available to remediate this issue.
AI Analysis
Technical Summary
The Twig sandbox in Craft CMS implements a SecurityPolicy that allowlists classes and their methods/properties for use in user-defined templates. Craft CMS marks the ElementInterface as safe via the AllowedInSandbox attribute, which includes classes that extend yii\base\Component from the Yii framework. The yii\base\Component class contains a known function-call gadget that enables arbitrary code execution. Due to lax allowlisting, this gadget is accessible within the sandbox, allowing authenticated users with control panel access to execute arbitrary code by rendering malicious Twig templates. This vulnerability is similar to previously disclosed RCEs in Craft CMS related to the same gadget. A patch is available for affected versions.
Potential Impact
An authenticated attacker with permission to access the Craft CMS control panel can achieve remote code execution by rendering a malicious Twig template, even if the Twig sandbox is enabled. This allows execution of arbitrary code on the server, potentially leading to full system compromise.
Mitigation Recommendations
A patch is available for this vulnerability. Users should upgrade to Craft CMS versions 4.18.3 or later and 5.10.7 or later to remediate the issue. Until patched, restricting control panel access to trusted users is recommended. No other specific mitigations are indicated.
Craft CMS: Authenticated RCE through Twig sandbox escape (CVE-2026-72781)
Description
Craft CMS contains an authenticated remote code execution (RCE) vulnerability via the Twig sandbox escape mechanism. The vulnerability arises because the Twig sandbox's allowlisting permits dangerous functionality from the Yii framework, specifically through a function-call gadget in yii\base\Component. An authenticated user with control panel access can exploit this by rendering a malicious Twig template, bypassing sandbox protections. This affects Craft CMS versions from 4.0.0-RC1 up to but not including 4.18.3, and 5.0.0-RC1 up to but not including 5.10.7. A patch is available to remediate this issue.
CVSS v4.0
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The Twig sandbox in Craft CMS implements a SecurityPolicy that allowlists classes and their methods/properties for use in user-defined templates. Craft CMS marks the ElementInterface as safe via the AllowedInSandbox attribute, which includes classes that extend yii\base\Component from the Yii framework. The yii\base\Component class contains a known function-call gadget that enables arbitrary code execution. Due to lax allowlisting, this gadget is accessible within the sandbox, allowing authenticated users with control panel access to execute arbitrary code by rendering malicious Twig templates. This vulnerability is similar to previously disclosed RCEs in Craft CMS related to the same gadget. A patch is available for affected versions.
Potential Impact
An authenticated attacker with permission to access the Craft CMS control panel can achieve remote code execution by rendering a malicious Twig template, even if the Twig sandbox is enabled. This allows execution of arbitrary code on the server, potentially leading to full system compromise.
Mitigation Recommendations
A patch is available for this vulnerability. Users should upgrade to Craft CMS versions 4.18.3 or later and 5.10.7 or later to remediate the issue. Until patched, restricting control panel access to trusted users is recommended. No other specific mitigations are indicated.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-f5wm-88jv-g5hx
- Osv Schema Version
- 1.4.0
- Ecosystems
- ["Packagist"]
- Database Specific Severity
- HIGH
- Cvss Version
- 4.0
Threat ID: 6a7573bfbf8831d539d943e0
Added to database: 08/07/2026, 05:57:19 UTC
Last enriched: 09/12/2026, 06:32:07 UTC
Last updated: 09/22/2026, 23:09:54 UTC
Views: 50
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.