GHSA-hq84-x37p-j6q5: XSS
Impact
Affected versions of Winter CMS render the search query parameter without HTML encoding inside a <script type="text/template"> block in the backend Table widget partial (modules/backend/widgets/table/partials/table.php):
php value="<?= get('search') ?>"
<script> is an HTML raw-text context, so the surrounding value="…" attribute quoting is not a parser boundary. A literal </script> in the query string terminates the template element early, and everything after it is parsed as ordinary markup in the backend document.
Any backend page rendering a Table or DataTable widget is a sink. The value is read from the global request through the get() helper, which — unlike post() — is not restricted by HTTP method, so a plain top-level GET navigation is sufficient. The template is also emitted unconditionally by the partial, so widgets using the default searching: false configuration are equally affected.
In Winter core the reachable route is the Editor Settings form (/backend/system/settings/update/winter/backend/editor), which renders six datatable fields and is gated by backend.manageeditor — assigned by default to the built-in Developer role. Third-party plugins using the datatable form widget, or the Table widget directly, expose the same sink on their own pages.
An attacker who induces a signed-in backend user to follow a crafted link executes script in that user's authenticated backend origin. The injected script can read the CSRF token published in the backend layout's <meta name="csrf-token"> element and issue credentialed requests as the victim, bounded only by that user's permissions. Because the core sink requires backend.manageeditor, the practical victim is a Developer-role user or superuser — who can edit CMS templates, so script running in that session can chain to server-side code execution.
This is not a permission bypass: the victim must already be authorised for the page, and the attacker gains no permission the victim does not hold.
To actively exploit this issue, an attacker needs no account of their own, but does need an authenticated backend user with access to a page rendering a Table or DataTable widget to follow an attacker-supplied link.
Patches
The search value is now HTML-encoded on output, matching every other value rendered by the same partial and the equivalent handling in the backend Search widget (modules/backend/widgets/search/partials/search.php):
php value="<?= e(get('search')); ?>"
This removes the raw-text terminator: the browser can no longer encounter an attacker-supplied literal </script> while tokenising the document. The template is subsequently parsed once by jQuery when the toolbar is built, so an encoded payload resolves to an inert attribute string rather than markup.
Regression coverage was added in modules/backend/tests/widgets/TableSearchEscapingTest.php, covering plain, mixed-case (</ScRiPt>) and whitespace-bearing (</script >) terminators, both searching states, and preservation of ordinary and Unicode search text.
This security issue has been fixed in v1.2.14.
Workarounds
If you cannot upgrade, apply https://github.com/wintercms/winter/commit/1b6397654124fb44a6abf6f3782b6a1d746cef14 manually — in modules/backend/widgets/table/partials/table.php, change:
php value="<?= get('search') ?>"
to:
php value="<?= e(get('search')); ?>"
A restrictive Content Security Policy served at the web server or reverse proxy can reduce practical exploitability, but it is not a substitute for the fix: Winter's backend ships inline scripts, so a policy permissive enough to run the backend may still permit an injected execution primitive.
References
Credit to Awwader (@NRAwwad) for reporting the issue.
For more information
If you have any questions or comments about this advisory: - Email us at hello@wintercms.com
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
composer/winter/wn-backend-moduleto a version that resolves this vulnerability.Fixed in 1.2.14 - Upgrade
Upgrade
wintercms/winterto a version that resolves this vulnerability.Fixed in v1.2.14Patch 1b6397654124fb44a6abf6f3782b6a1d746cef14 - Configuration
In modules/backend/widgets/table/partials/_table.php, within the inline `<script type="text/template">` used for the Table widget search, change the rendered template field so the `search` query parameter is HTML-encoded on output: replace `value="<?= get('search') ?>"` with `value="<?= e(get('search')); ?>"`. (As described in commit 1b6397654124fb44a6abf6f3782b6a1d746cef14).
Winter CMS backend Table widget partial (modules/backend/widgets/table/partials/_table.php) search query parameter output encoding in <script type="text/template"> = value="<?= e(get('search')); ?>" (instead of unencoded get('search') / raw-text terminator) - Compensating control
If you cannot upgrade, deploy a restrictive Content Security Policy served at the web server or reverse proxy to reduce practical exploitability (note: not a substitute for the fix because Winter backend ships inline scripts).
- Compensating control
Apply access control to reduce who can reach pages that render the Table/DataTable widgets: the reachable sink route in Winter core is gated by `backend.manage_editor` on the Editor Settings form (`/backend/system/settings/update/winter/backend/editor`), which is assigned by default to the built-in Developer role.
Event History
Frequently Asked Questions
Can this be triggered with a normal browser request?
Yes. The value is read from the global request via get(), which is not limited to a particular HTTP method, so a top-level GET navigation with a crafted search parameter is sufficient.
Does disabling table searching prevent exposure?
No. The affected template is emitted unconditionally by the Table widget partial, so widgets configured with the default searching: false setting are also affected.
Which built-in backend location is known to render the affected widget?
The Editor Settings form at /backend/system/settings/update/winter/backend/editor is identified as a reachable core route. It renders six datatable fields and requires the backend.manage_editor permission.