Skip to content

Winter CMS Modules allows a sandbox bypass in Twig templates leading to data modification and deletion

High severity GitHub Reviewed Published Dec 9, 2024 in wintercms/winter • Updated Dec 9, 2024

Package

composer winter/wn-cms-module (Composer)

Affected versions

>= 1.2.0, < 1.2.7
>= 1.1.0, < 1.1.11
< 1.0.476

Patched versions

1.2.7
1.1.11
1.0.476

Description

Impact

Affected versions of Winter CMS allow users with access to the CMS templates sections that modify Twig files to bypass the sandbox placed on Twig files and modify resources such as theme customisation values or modify, or remove, templates in the theme even if not provided direct access via the permissions.

As all objects passed through to Twig are references to the live objects, it is also possible to also manipulate model data if models are passed directly to Twig, including changing attributes or even removing records entirely. In most cases, this is unwanted behavior and potentially dangerous.

To actively exploit this security issue, an attacker would need access to the Backend with a user account with any of the following permissions:

  • cms.manage_layouts
  • cms.manage_pages
  • cms.manage_partials

The Winter CMS maintainers strongly recommend that these permissions only be reserved to trusted administrators and developers in general.

Patches

In order to mitigate this issue, we have significantly increased the scope of the sandbox, effectively making all models and datasources read-only in Twig.

This security issue has been fixed as of wintercms/winter@fb88e6f.

Workarounds

If you cannot upgrade, you may apply commit wintercms/winter@fb88e6f to your Winter CMS installation manually to resolve this issue.

In the rare event that you were relying on being able to write to models/datasources within your Twig templates, you should instead use or create components to make changes to your models.

References

@bennothommo bennothommo published to wintercms/winter Dec 9, 2024
Published to the GitHub Advisory Database Dec 9, 2024
Reviewed Dec 9, 2024
Published by the National Vulnerability Database Dec 9, 2024
Last updated Dec 9, 2024

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
High
User interaction
Required
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:H

EPSS score

0.043%
(11th percentile)

Weaknesses

CVE ID

CVE-2024-54149

GHSA ID

GHSA-xhw3-4j3m-hq53

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.