Skip to content
Threat Feed
high advisory

Winter CMS Twig Sandbox Escape Vulnerability

Authenticated backend users with template-editing privileges can bypass the Winter CMS Twig sandbox to execute arbitrary PHP or SQL, stemming from an incomplete fix for CVE-2024-54149.

CVE search metadata

CVE search record: CVE-2024-54149. Severity: high. CVSS: 8.4. EPSS: 0.40%. KEV: no. Product: Winter CMS (1.2). Brief: Winter CMS Twig Sandbox Escape Vulnerability. Brief link: https://feed.craftedsignal.io/briefs/2026-08-winter-cms-sandbox-escape/

Winter CMS contains a sandbox escape vulnerability within its Twig template security policy, resulting from an incomplete fix for CVE-2024-54149. This vulnerability allows authenticated backend users possessing specific CMS template-editing permissions (cms.manage_pages, cms.manage_layouts, or cms.manage_partials) to escape the Twig "safe mode" sandbox. The flaw exists because the existing security blocklist in System\Twig\SecurityPolicy failed to account for recursive method forwarding in Eloquent models and query builders. By leveraging methods like saveQuietly, increment, or getConnection, an attacker can manipulate database records, execute arbitrary SQL, or achieve remote code execution by injecting PHP into CMS templates. The issue is addressed in Winter CMS v1.2.13.

Impact

Successful exploitation allows an authenticated user to escalate privileges or gain remote code execution within the context of the web application. Attackers can perform unauthorized database operations, including dropping tables, modifying administrative credentials, or executing arbitrary system-level code if the server configuration permits. This affects all users running vulnerable versions of the system module prior to v1.2.13.

Recommendation

  • Upgrade to Winter CMS v1.2.13 or later immediately to patch the SecurityPolicy logic.
  • Clear the compiled Twig template cache using "php artisan cache:clear" after upgrading to ensure the new security policy is applied to existing templates.
  • Audit and restrict administrative permissions for "cms.manage_pages", "cms.manage_layouts", and "cms.manage_partials" to trusted users only, as these are prerequisites for exploiting this vulnerability.

Immediate actions

Upgrade Winter CMS to v1.2.13

IT Operations 24h

Mitigations

Restrict CMS template editing permissions to trusted users

immediate System Administration

cms.manage_pages, cms.manage_layouts, cms.manage_partials