Skip to main content

Craft CMS: Authenticated RCE through Twig sandbox escape (CVE-2026-72781)

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

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

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: 09/12/2026, 06:32:07 UTC

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.

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