Skip to content
Heist/ feed
Back to feed
High

Craft CMS 5.0.0-RC1 before 5.10.7 Remote Code Execution via Twig Sandbox Escape

Type: advisorySources: OSV

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().

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-72781
Confirmed fixed CVEs
Not specified
Updated in this feed
5 Nov 2026, 00:05 UTC · Revision 1

Source evidence

Craft CMS 5.0.0-RC1 before 5.10.7 Remote Code Execution via Twig Sandbox Escape

core-osv · Original source

Published 11 Aug 2026, 12:17 UTC

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().

osv:CVE-2026-72781
Complete source record
{
  "id": "7de41a20fe15f2f7e03578164bda5bca0d1cb7abb5b85c173ac4c8fe39969f7f",
  "url": "https://osv.dev/vulnerability/CVE-2026-72781",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Craft CMS 5.0.0-RC1 before 5.10.7 Remote Code Execution via Twig Sandbox Escape",
    "summary": "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().",
    "evidence": "osv:CVE-2026-72781",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2026-72781",
      "aliases": [
        "CVE-2026-72781",
        "GHSA-f5wm-88jv-g5hx"
      ],
      "metrics": [
        {
          "type": "CVSS_V4",
          "score": "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": [
        {
          "ranges": [
            {
              "repo": "https://github.com/craftcms/cms",
              "type": "GIT",
              "events": [
                {
                  "introduced": "04755d93f86d07cc183db47db8a0eee106892e30"
                },
                {
                  "fixed": "6a08356668f772f0a4d79769d3de83508cd4e21c"
                },
                {
                  "introduced": "daac7c1da2f701f2e9ddee1da1457ce61660b581"
                },
                {
                  "fixed": "a65e9f5b33801cd89d859cee78573fd04df1ed57"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "5.0.0-RC1"
                      },
                      {
                        "fixed": "5.10.7"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StandardRange"
                  },
                  {
                    "range": [
                      {
                        "introduced": "4.0.0-RC1"
                      },
                      {
                        "fixed": "4.18.3"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StandardRange"
                  }
                ]
              }
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-72781.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:40.561962448Z",
      "provider": "osv",
      "references": [
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/72xxx/CVE-2026-72781.json",
        "https://github.com/craftcms/cms/security/advisories/GHSA-f5wm-88jv-g5hx",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-72781",
        "https://www.vulncheck.com/advisories/craft-cms-rc1-before-remote-code-execution-via-twig-sandbox-escape"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-693"
        ],
        "cna_assigner": "VulnCheck",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/72xxx/CVE-2026-72781.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-72781",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 508251,
  "published_at": "2026-08-11T12:17:16.358+00:00"
}