Craft CMS authenticated RCE through Twig sandbox escape

Severity: high · CVSS 8.8 · Published 2026-08-11

Craft CMS is a popular content management system used to build and manage websites. The vulnerability allows authenticated users with control panel access to execute arbitrary code on the server by crafting malicious Twig templates, even when security sandboxing is enabled. This could lead to complete server compromise, data theft, and website defacement.

Technologies: craftcms/cms (Packagist). Vendors: Packagist.

Quick answers

Is This vulnerability exploited in the wild?
No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.
How severe is This vulnerability?
High severity, with a CVSS score of 8.8, published 11 August 2026.
Which products and versions are affected?
craftcms/cms (Packagist) >= 4.0.0-RC1, < 4.18.3.
Is there a fix for This vulnerability?
A patch was published on 2026-08-11: Patches released: version 4.18.3 and 5.10.7 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is This vulnerability attacked?
It is attacked over the network, in a web application.
Am I affected?
Check whether you run craftcms/cms (Packagist) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

Technical details

The vulnerability is a protection mechanism failure (CWE-693) in Craft CMS's Twig sandbox implementation. Craft marks ElementInterface as safe via the AllowedInSandbox attribute, and the sandbox allowlisting extends through the entire class hierarchy from craft\base\Component up to yii\base\Component. The yii\base\Component class contains a known arbitrary function-call gadget previously exploited in prior Craft CMS RCE vulnerabilities (GHSA-255j-qw47-wjh5, GHSA-2fph-6v5w-89hh, GHSA-7jx7-3846-m7w7, GHSA-qrgm-p9w5-rrfw). An authenticated attacker with permission to access the control panel can leverage this gadget to achieve RCE by rendering a malicious Twig template, bypassing the enableTwigSandbox() protection. Patches are available in versions 4.18.3 and 5.10.7.

Affected products

  • Craft CMS Craft CMS >= 4.0.0-RC1, < 4.18.3
  • Craft CMS Craft CMS >= 5.0.0-RC1, < 5.10.7

Timeline

  • 2026-07-25: disclosed: Original advisory GHSA-f5wm-88jv-g5hx published
  • 2026-08-11: advisory: Duplicate advisory GHSA-h784-hpjp-2rrm and CVE-2026-72781 published
  • 2026-08-11: patched: Patches released: version 4.18.3 and 5.10.7
  • 2026-09-01: other: Duplicate advisory GHSA-h784-hpjp-2rrm withdrawn

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.