Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

Craft CMS: Authenticated RCE through Twig sandbox escape

0
High
Published: 08/06/2026 (08/06/2026, 21:02:28 UTC)
Source: GCVE Database
Product: craftcms/cms

Description

Craft CMS contains a vulnerability in its Twig sandbox mechanism that allows authenticated users with control panel access to execute remote code. The issue arises because the sandbox's allowlisting permits dangerous functionality from the Yii framework, specifically through a known arbitrary function call gadget in yii\base\Component. This enables malicious Twig templates to bypass sandbox restrictions and achieve remote code execution (RCE).

CVSS v4.0

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
Low
User Interaction
None
Vuln. Confidentiality
High
Vuln. Integrity
High
Vuln. Availability
High
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Affected software

Packagistghsa
craftcms/cms
Affected versions
>=5.0.0-RC1 <5.10.7
Packagistghsa
craftcms/cms
Affected versions
>=4.0.0-RC1 <4.18.3

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 08/07/2026, 06:26:06 UTC

Technical Analysis

The Twig sandbox in Craft CMS implements a SecurityPolicy that allowlists classes, methods, and properties for use in user-defined templates. However, the allowlisting mechanism is overly permissive, allowing all methods and properties of an allowed class and its subclasses. Craft CMS marks the ElementInterface as safe, and since Element extends craft\base\Component, which in turn extends yii\base\Component, the sandbox inadvertently permits access to a dangerous function call gadget in yii\base\Component. This gadget has been previously exploited in multiple Craft CMS RCE vulnerabilities. Consequently, an authenticated attacker with control panel access can render a malicious Twig template to achieve remote code execution, even when the Twig sandbox is enabled.

Potential Impact

An authenticated attacker with permission to access the Craft CMS control panel can exploit this vulnerability to execute arbitrary code on the server. This compromises the confidentiality, integrity, and availability of the affected system. The vulnerability bypasses the intended restrictions of the Twig sandbox, enabling remote code execution despite sandbox protections.

Mitigation Recommendations

A patch is available for this vulnerability. It is recommended to apply the official fix provided by Craft CMS to remediate the issue. Until patched, restrict control panel access to trusted users only. Review and update Twig sandbox allowlists to avoid permitting dangerous classes or methods. Monitor vendor advisories for updated remediation guidance.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
GHSA-f5wm-88jv-g5hx
Osv Schema Version
1.4.0
Aliases
[]
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: 08/07/2026, 06:26:06 UTC

Last updated: 08/07/2026, 06:26:06 UTC

Views: 2

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses