Skip to content

Local File Inclusion through @import directives in LESS compilation of backend customizable stylesheets and theme assets

Moderate
LukeTowers published GHSA-58fp-mcx6-7qf9 Aug 7, 2026

Package

composer winter/wn-backend-module (Composer)

Affected versions

<= 1.2.12

Patched versions

1.2.13

Description

Impact

Affected versions of Winter CMS allow authenticated backend users with the following permissions to disclose arbitrary files readable by the PHP process by injecting @import (inline) "<path>" directives into LESS source that the backend compiles. Four entry points share the same root cause:

  • Brand Settings BrandSetting.custom_css field (backend.manage_branding) — compiled inline into every backend page's <style> block.
  • Editor Settings EditorSetting.html_custom_styles field (backend.manage_editor) — compiled inline into every backend page's <style> block.
  • Mail Brand Settings MailBrandSetting colour-picker fields (system.manage_mail_templates) — values are concatenated into LESS source via Less_Parser::ModifyVars() with no escaping, so any value the form validator does not reject can carry an @import directive.
  • Theme .less/.sass/.scss assets (cms.manage_assets) — compiled through System\Classes\CombineAssets when served, with the same Less_Parser configuration. Both absolute paths and .. traversal escape from the asset's own tree were exploitable.

The leaked content includes any file the web process can read, most importantly the application .env file (disclosing APP_KEY and database credentials).

To actively exploit this issue, an attacker would need an authenticated backend account with one of the permissions listed above. By default these are assigned to the built-in Developer role.

Patches

The root cause is in the wikimedia/less.php integration in Winter Storm: Less_Parser was instantiated without a safe import resolver, and its Less_FileManager::getFilePath() falls back to the raw attacker-supplied path when no candidate root matches. Storm now ships a LessImportResolver that uses the callable form of Less_Parser::SetImportDirs() to refuse any @import whose resolved path lies outside the calling context's allowed roots, defeating both absolute paths and .. traversal at the parser level.

The four sinks have been updated to use the resolver. The three settings models pass no allowed roots (deny-all) because the bundled stylesheets ship no @import directives and the user fields have no legitimate use for them. System\Classes\CombineAssets configures the theme-asset compiler with themes_path(), plugins_path(), and base_path('modules') as allowed roots, preserving real cross-tree imports observed in shipped themes and plugins.

This security issue has been fixed in v1.2.13 (Winter core) and v1.2.13 (Winter Storm).

Workarounds

If you cannot upgrade, apply wintercms/storm@af77033 and 130f0ea manually. As an interim mitigation, remove cms.manage_assets from any non-trusted role and clear any non-empty value from the Brand Settings custom_css and Editor Settings html_custom_styles fields.

References

See GHSA-3888-q23f-x7qh for the related (but distinct in scope) October CMS advisory addressing the theme-asset compiler path. The Brand/Editor/Mail Brand Settings sinks reported in this advisory are not covered by the October patch.

Credit to Nguyen Van Hiep (@hypnguyen1209) from Lo Security for reporting the issue.

For more information

If you have any questions or comments about this advisory:

Severity

Moderate

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
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

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:N/S:U/C:H/I:N/A:N

CVE ID

CVE-2026-63179

Weaknesses

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. Learn more on MITRE.

Credits