CVE-2024-54149 Overview
CVE-2024-54149 is a sandbox bypass vulnerability in Winter CMS, an open-source content management system built on the Laravel PHP framework. Authenticated backend users with template editing permissions can escape the Twig sandbox and modify theme resources, templates, and live model data. Because objects passed to Twig are references to live instances, attackers can alter attributes or delete database records. The flaw affects Winter CMS versions prior to 1.2.7, 1.1.11, and 1.0.476. The maintainers assigned this issue [CWE-184: Incomplete List of Disallowed Inputs].
Critical Impact
Backend users with cms.manage_layouts, cms.manage_pages, or cms.manage_partials permissions can bypass the Twig sandbox to modify or delete theme templates and manipulate live model data, including record deletion.
Affected Products
- Winter CMS versions prior to 1.2.7
- Winter CMS 1.1.x versions prior to 1.1.11
- Winter CMS 1.0.x versions prior to 1.0.476
Discovery Timeline
- 2024-12-09 - CVE-2024-54149 published to NVD
- 2024-12-09 - Winter CMS security advisory GHSA-xhw3-4j3m-hq53 published
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2024-54149
Vulnerability Analysis
Winter CMS renders theme content through Twig templates, which are supposed to run inside a sandbox that restricts sensitive operations. The sandbox implementation in affected versions did not fully cover model and datasource objects passed into template context. Backend users granted CMS template permissions could author Twig markup that reached beyond the sandbox and interacted directly with the underlying PHP objects.
Because template variables are references to live model instances, an attacker could invoke setters, save records, or trigger deletions. This allowed modification of theme customization values, template files, and any Eloquent model reachable from the template scope. The behavior effectively converts a template editing role into a broader write primitive against theme storage and application data.
Root Cause
The root cause is an incomplete sandbox policy over objects exposed to Twig templates. The Twig sandbox restricted certain function and tag usage but did not treat model and datasource objects as read-only. The patch reworks how CMS classes such as Cms\Classes\Theme and Cms\Models\ThemeData expose data, and it expands the sandbox to make models and datasources read-only within Twig contexts.
Attack Vector
Exploitation requires an authenticated backend user holding cms.manage_layouts, cms.manage_pages, or cms.manage_partials. The attacker edits a layout, page, or partial and injects Twig markup that dereferences objects in the template scope to call model methods. Rendering the affected template triggers the write operation on the server. No unauthenticated network access is possible; the attack requires user interaction across a security boundary because a privileged session must load or preview the modified template.
// Security patch excerpt: modules/cms/classes/Theme.php
// The patch reorganizes imports to explicit Winter\Storm and Illuminate facades,
// part of the broader refactor that makes theme data read-only inside Twig.
-<?php namespace Cms\Classes;
+<?php
+
+namespace Cms\Classes;
use Cms\Models\ThemeData;
use DirectoryIterator;
use Exception;
+use Illuminate\Support\Facades\App;
+use Illuminate\Support\Facades\Cache;
+use Illuminate\Support\Facades\Lang;
use System\Models\Parameter;
+use Winter\Storm\Exception\ApplicationException;
+use Winter\Storm\Exception\SystemException;
use Winter\Storm\Halcyon\Datasource\DatasourceInterface;
use Winter\Storm\Halcyon\Datasource\DbDatasource;
use Winter\Storm\Halcyon\Datasource\FileDatasource;
+use Winter\Storm\Support\Facades\Config;
+use Winter\Storm\Support\Facades\Event;
+use Winter\Storm\Support\Facades\File;
Source: Winter CMS commit fb88e6fabde3b3278ce1844e581c87dcf7daee22
Detection Methods for CVE-2024-54149
Indicators of Compromise
- Unexpected changes to theme files under the themes/ directory or edits to layouts, pages, and partials outside of change-management windows.
- Rows added, modified, or removed in the cms_theme_data table without a corresponding administrative action.
- Twig markup in templates that references model methods such as save(), delete(), update(), or forceDelete().
- Backend audit log entries showing template edits by accounts that do not normally develop themes.
Detection Strategies
- Diff current theme template files against the last known-good version from source control to surface unauthorized Twig modifications.
- Grep template files for method calls on model variables, especially destructive methods, that should not appear in presentation logic.
- Review database change logs and application logs for record deletions or attribute changes that correlate with template rendering events.
Monitoring Recommendations
- Enable file integrity monitoring on the themes/ directory and alert on writes originating from the web server user.
- Forward Winter CMS backend activity logs to a centralized log store and alert on template edits performed by non-developer accounts.
- Monitor authentication and permission-grant events for the cms.manage_layouts, cms.manage_pages, and cms.manage_partials permissions.
How to Mitigate CVE-2024-54149
Immediate Actions Required
- Upgrade Winter CMS to 1.2.7, 1.1.11, or 1.0.476 depending on the branch in use.
- Audit backend accounts and revoke cms.manage_layouts, cms.manage_pages, and cms.manage_partials from any user who is not a trusted administrator or developer.
- Review recent template changes and database state for signs of unauthorized modification.
Patch Information
The fix is delivered in commit fb88e6fabde3b3278ce1844e581c87dcf7daee22, which expands the Twig sandbox to make models and datasources read-only within templates. Sites that cannot upgrade immediately can apply this commit manually to their installation. Full details are available in the Winter CMS security advisory GHSA-xhw3-4j3m-hq53 and the upstream patch commit.
Workarounds
- Restrict backend permissions so only trusted administrators hold cms.manage_layouts, cms.manage_pages, and cms.manage_partials.
- Refactor any templates that intentionally mutate model data to use Winter CMS components instead of writing through Twig.
- Enforce peer review on template changes and pin theme directories under version control to detect out-of-band edits.
# Verify installed Winter CMS version and upgrade via Composer
php artisan winter:version
composer require winter/winter:^1.2.7
php artisan winter:up
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

