GHSA-8CFW-PCWH-V63W
Vulnerability from github – Published: 2026-08-20 18:44 – Updated: 2026-08-20 18:44Impact
Affected versions of Winter CMS allow authenticated backend users with CMS template-editing permissions to escape the Twig sandbox ("safe mode") that is meant to restrict what template code can do. Using any of the following permissions, an attacker can read and modify arbitrary database records, execute arbitrary SQL (including DDL such as DROP TABLE), exfiltrate sensitive data such as backend administrator credentials, and achieve remote code execution by injecting PHP into a CMS page, layout, or partial code section:
cms.manage_pagescms.manage_layoutscms.manage_partials
This is an incomplete-fix follow-up to CVE-2024-54149 (GHSA-xhw3-4j3m-hq53). That fix added a blocklist of dangerous methods to System\Twig\SecurityPolicy, but the blocklist missed a large number of equivalent methods and did not account for the way Eloquent models forward calls to the query builder. As a result the sandbox could be bypassed through — among others — saveQuietly()/deleteQuietly(), increment()/decrement(), newQuery(), getConnection(), getConnectionResolver(), relation and pivot methods, and higher-order collection methods that execute callables.
To actively exploit this issue, an attacker would need an authenticated backend account with one of the permissions listed above. These permissions are intended for trusted developers/administrators, and the sandbox is the additional protection layer this advisory is concerned with.
Patches
System\Twig\SecurityPolicy has been reworked so that the blocklist reflects the real method-forwarding behaviour of the database layer rather than a flat list of method names. A method blocked on the query builder is now also blocked when it is reached through a model, Eloquent builder, or relation (via a transitive forwarder chain), which closes the __call forwarding escape that made the previous blocklist bypassable. In addition, the per-class blocklists have been expanded, the database connection and connection resolver are locked down, the source() and constant() Twig functions are restricted, and a SafeCollection/SafePaginator layer neutralises callable arguments passed to higher-order collection and paginator methods. Read-only query building continues to work as before; only data modification, raw SQL/connection access, and callable execution are blocked.
This security issue has been fixed in v1.2.13.
After upgrading, clear the compiled Twig template cache (e.g. php artisan cache:clear) so that existing templates recompile under the updated policy.
Workarounds
If you cannot upgrade immediately, apply https://github.com/wintercms/winter/commit/725bbcda232466f7f71381c271c6916573d576e6 manually. As an interim mitigation, restrict cms.manage_pages, cms.manage_layouts, and cms.manage_partials to fully trusted administrators only, since these permissions grant the ability to edit template code that the sandbox is designed to contain.
References
- Original issue: CVE-2024-54149 / GHSA-xhw3-4j3m-hq53 — this advisory addresses an incomplete fix for it.
Credit to Mounir Elsrogy (@M9nx) for reporting the issue.
For more information
If you have any questions or comments about this advisory: - Email us at hello@wintercms.com
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "winter/wn-system-module"
},
"ranges": [
{
"events": [
{
"introduced": "1.2.7"
},
{
"fixed": "1.2.13"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-693"
],
"github_reviewed": true,
"github_reviewed_at": "2026-08-20T18:44:23Z",
"nvd_published_at": null,
"severity": "HIGH"
},
"details": "### Impact\n\nAffected versions of Winter CMS allow authenticated backend users with CMS template-editing permissions to escape the Twig sandbox (\"safe mode\") that is meant to restrict what template code can do. Using any of the following permissions, an attacker can read and modify arbitrary database records, execute arbitrary SQL (including DDL such as `DROP TABLE`), exfiltrate sensitive data such as backend administrator credentials, and achieve remote code execution by injecting PHP into a CMS page, layout, or partial code section:\n\n- **`cms.manage_pages`**\n- **`cms.manage_layouts`**\n- **`cms.manage_partials`**\n\nThis is an incomplete-fix follow-up to CVE-2024-54149 (GHSA-xhw3-4j3m-hq53). That fix added a blocklist of dangerous methods to `System\\Twig\\SecurityPolicy`, but the blocklist missed a large number of equivalent methods and did not account for the way Eloquent models forward calls to the query builder. As a result the sandbox could be bypassed through \u2014 among others \u2014 `saveQuietly()`/`deleteQuietly()`, `increment()`/`decrement()`, `newQuery()`, `getConnection()`, `getConnectionResolver()`, relation and pivot methods, and higher-order collection methods that execute callables.\n\nTo actively exploit this issue, an attacker would need an authenticated backend account with one of the permissions listed above. These permissions are intended for trusted developers/administrators, and the sandbox is the additional protection layer this advisory is concerned with.\n\n### Patches\n\n`System\\Twig\\SecurityPolicy` has been reworked so that the blocklist reflects the real method-forwarding behaviour of the database layer rather than a flat list of method names. A method blocked on the query builder is now also blocked when it is reached through a model, Eloquent builder, or relation (via a transitive forwarder chain), which closes the `__call` forwarding escape that made the previous blocklist bypassable. In addition, the per-class blocklists have been expanded, the database connection and connection resolver are locked down, the `source()` and `constant()` Twig functions are restricted, and a `SafeCollection`/`SafePaginator` layer neutralises callable arguments passed to higher-order collection and paginator methods. Read-only query building continues to work as before; only data modification, raw SQL/connection access, and callable execution are blocked.\n\nThis security issue has been fixed in [v1.2.13](https://github.com/wintercms/winter/commit/725bbcda232466f7f71381c271c6916573d576e6).\n\nAfter upgrading, clear the compiled Twig template cache (e.g. `php artisan cache:clear`) so that existing templates recompile under the updated policy.\n\n### Workarounds\n\nIf you cannot upgrade immediately, apply https://github.com/wintercms/winter/commit/725bbcda232466f7f71381c271c6916573d576e6 manually. As an interim mitigation, restrict `cms.manage_pages`, `cms.manage_layouts`, and `cms.manage_partials` to fully trusted administrators only, since these permissions grant the ability to edit template code that the sandbox is designed to contain.\n\n### References\n\n- Original issue: CVE-2024-54149 / GHSA-xhw3-4j3m-hq53 \u2014 this advisory addresses an incomplete fix for it.\n\nCredit to Mounir Elsrogy ([@M9nx](https://github.com/M9nx)) for reporting the issue.\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n- Email us at [hello@wintercms.com](mailto:hello@wintercms.com)",
"id": "GHSA-8cfw-pcwh-v63w",
"modified": "2026-08-20T18:44:23Z",
"published": "2026-08-20T18:44:23Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/wintercms/winter/security/advisories/GHSA-8cfw-pcwh-v63w"
},
{
"type": "WEB",
"url": "https://github.com/wintercms/winter/commit/725bbcda232466f7f71381c271c6916573d576e6"
},
{
"type": "ADVISORY",
"url": "https://github.com/advisories/GHSA-xhw3-4j3m-hq53"
},
{
"type": "PACKAGE",
"url": "https://github.com/wintercms/winter"
},
{
"type": "WEB",
"url": "https://github.com/wintercms/winter/releases/tag/v1.2.13"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "Winter: Authenticated Twig sandbox escape in CMS SecurityPolicy (bypass of CVE-2024-54149)"
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.