GHSA-8cfw-pcwh-v63w: Winter Authenticated Twig Sandbox Escape Vulnerability

HIGH
CVSS 8.4
CWE-693
Published
Advisory Summary

GHSA-8cfw-pcwh-v63w is a HIGH (CVSS 8.4) authenticated twig sandbox escape vulnerability (CWE-693: Protection Mechanism Failure) affecting Winter libraries in the Packagist ecosystem. The issue involves authenticated twig sandbox escape in cms securitypolicy (bypass of cve-2024-54149). Remediation is available by upgrading affected packages to version 1.2.13.

GHSA-8cfw-pcwh-v63w at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-8cfw-pcwh-v63w
Severity HIGH
CVSS v3.1 Base Score 8.4
CWE Classification CWE-693: Protection Mechanism Failure
Affected Product Winter
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 8.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required High (PR:H)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix GHSA-8cfw-pcwh-v63w

To remediate this vulnerability, upgrade all affected Winter dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

winter/wn-system-module fixed: 1.2.13
Upgrade winter/wn-system-module to 1.2.13
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for winter/wn-system-module

How to Check if You Are Affected

To determine whether your application is affected by GHSA-8cfw-pcwh-v63w, inspect your project dependencies for Winter:

inspect dependencies for winter/wn-system-module

Analyze the terminal output to locate any version of Winter in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.2.13), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-693: Protection Mechanism Failure, where the product does not use or incorrectly uses a protection mechanism that provides sufficient defense against directed attacks against the product. In Winter, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact 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_pages`** - **`cms.manage_layouts`** - **`cms.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](https://github.com/wintercms/winter/commit/725bbcda232466f7f71381c271c6916573d576e6). 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](https://github.com/M9nx)) for reporting the issue. ### For more information If you have any questions or comments about this advisory: - Email us at [hello@wintercms.com](mailto:hello@wintercms.com)

GHSA-8cfw-pcwh-v63w Affected Winter Versions

1 component(s)
Fixed Versions:
1.2.13
Product / Package Ecosystem Affected Versions Fixed Version
winter/wn-system-module
Packagist
≥ 1.2.7
< 1.2.13
1.2.13

References

Frequently Asked Questions

What is GHSA-8cfw-pcwh-v63w?
GHSA-8cfw-pcwh-v63w is a security vulnerability in Winter involving Authenticated Twig sandbox escape in CMS SecurityPolicy (bypass of CVE-2024-54149) under CWE-693: Protection Mechanism Failure.
Which Winter versions are affected?
Affected versions include releases prior to 1.2.13 across affected packages: winter/wn-system-module.
What version fixes GHSA-8cfw-pcwh-v63w?
Upgrading to 1.2.13 (or the latest patched release for your respective branch) resolves the vulnerability.
Is winter/wn-system-module affected?
Yes, winter/wn-system-module is affected in releases prior to 1.2.13. Upgrade your dependency to 1.2.13 or later.
What is the CVSS score of GHSA-8cfw-pcwh-v63w?
GHSA-8cfw-pcwh-v63w has a CVSS v3.1 base score of 8.4 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:H.
What CWE is associated with GHSA-8cfw-pcwh-v63w?
GHSA-8cfw-pcwh-v63w is classified under CWE-693: Protection Mechanism Failure (The product does not use or incorrectly uses a protection mechanism that provides sufficient defense against directed attacks against the product.).
How can I check Packagist dependencies for GHSA-8cfw-pcwh-v63w?
Run the dependency tree command: 'inspect dependencies for winter/wn-system-module'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-8cfw-pcwh-v63w",
  "modified" : "2026-08-20T18:44:23Z",
  "published" : "2026-08-20T18:44:23Z",
  "aliases" : [ ],
  "summary" : "Winter: Authenticated Twig sandbox escape in CMS SecurityPolicy (bypass of CVE-2024-54149)",
  "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 — among others — `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 — 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)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "winter/wn-system-module"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.2.7"
      }, {
        "fixed" : "1.2.13"
      } ]
    } ]
  } ],
  "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"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-693" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-08-20T18:44:23Z",
    "nvd_published_at" : null
  }
}