Junglewise Threat Intelligence

Winter CMS authenticated Twig sandbox escape in SecurityPolicy

Severity: high · CVSS 8.4 · Published 2026-08-20

Executive brief

Winter CMS, a popular open-source content management system, contains a vulnerability in its template sandbox security layer that allows authenticated backend users with template-editing permissions to execute arbitrary code and access sensitive data. An attacker with credentials to manage pages, layouts, or partials can bypass the sandbox protections designed to restrict what template code can do, leading to potential database manipulation, credential theft, and remote code execution on the server.

Technical details

The vulnerability is a sandbox escape (CWE-693: Protection Mechanism Failure) in Winter CMS's Twig template security layer. The root cause is that the initial CVE-2024-54149 fix implemented a blocklist of dangerous methods in System\Twig\SecurityPolicy but failed to account for how Eloquent ORM models forward method calls to the query builder through __call() magic methods. Attackers can chain calls through saveQuietly(), deleteQuietly(), increment(), decrement(), newQuery(), getConnection(), getConnectionResolver(), and relation methods to bypass the blocklist. Attack requires an authenticated backend account with cms.manage_pages, cms.manage_layouts, or cms.manage_partials permissions—these are intended for trusted developers/administrators but the sandbox is designed as an additional security layer. The patch reworked the SecurityPolicy to understand transitive method-forwarding chains, expanded per-class blocklists, locked down database connections, restricted source() and constant() Twig functions, and added SafeCollection/SafePaginator layers to neutralize callable arguments. The fix is available in v1.2.13.

Affected products

  • Winter CMS Winter CMS >=1.2.7, <1.2.13

Timeline

  • 2026-08-20: disclosed
  • 2026-08-20: patched: v1.2.13 released with comprehensive SecurityPolicy rework

References

Related threats