GHSA-3277-h8g9-qj5f: CSRF

Published Aug 20, 2026
·
Updated

Impact

The backend FileUpload form widget trusted an attacker-controlled fileid POST parameter when resolving the attachment it operates on. The lookup (FileUpload::getFileRecord()) resolved the posted id against the global systemfiles table without verifying that the file belonged to the widget's own relation, parent record, or deferred-binding session.

Any authenticated backend user who can reach a form containing a fileupload field — including the built-in My Account avatar field, which requires no specific backend permission — could therefore target a System\Models\File record belonging to another user or record and:

- modify its title and description via onSaveAttachmentConfig, and - change its sortorder via onSortAttachments (which passed posted ids straight to setSortableOrder(), an unscoped UPDATE ... WHERE id = ?).

The same unscoped lookup is reached by onLoadAttachmentConfig, onSaveAttachmentConfig, and onRemoveAttachment. Because all attachments share the single System\Models\File model and systemfiles table, an attacker was not limited to other users' avatars — any attachment on any model could be referenced by id. Attachment ids are sequential integers and are easily enumerated.

The confirmed impact is unauthorized integrity modification of arbitrary attachment metadata and ordering.

CSRF tokens are still verified on all POST requests, so an attacker must be authenticated to the backend with a valid session. To exploit this issue an attacker needs a backend account with any level of access.

Patches

The FileUpload widget now scopes every fileid lookup to the widget's own relation, including any files bound through the current deferred-binding session, so a posted id can no longer reference an unrelated System\Models\File record:

- getFileRecord() resolves the id through getRelationObject()->withDeferred($this->sessionKey)->find(...) rather than the global file model. This covers onLoadAttachmentConfig, onSaveAttachmentConfig, and onRemoveAttachment. - onSortAttachments() intersects the posted ids with the ids that actually belong to the relation before calling setSortableOrder().

This security issue has been fixed as of v1.2.13 (commit 9cb0ae5f9d837db141ab111c6a7de8eed9603d25).

Workarounds

There is no supported workaround other than upgrading. If you cannot upgrade immediately, you may apply the fix manually in modules/backend/formwidgets/FileUpload.php:

1. In getFileRecord(), replace $this->getRelationModel()->find(post('fileid')) with $this->getRelationObject()->withDeferred($this->sessionKey)->find(post('fileid')). 2. In onSortAttachments(), filter the posted sortOrder ids to those returned by $this->getRelationObject()->withDeferred($this->sessionKey)->pluck($keyName) before calling setSortableOrder().

Affected Software

1 affected componentFixes available
composer/winter/wn-backend-module<=1.2.12
1.2.13

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade composer/winter/wn-backend-module to a version that resolves this vulnerability.

    Fixed in 1.2.13
  2. Upgrade

    Upgrade wintercms/winter to a version that resolves this vulnerability.

    Fixed in v1.2.13Patch 9cb0ae5f9d837db141ab111c6a7de8eed9603d25
  3. Configuration

    If you cannot upgrade immediately, update FileUpload.php getFileRecord() to resolve the posted file_id within the widget's own relation scoped to the current deferred-binding session.

    modules/backend/formwidgets/FileUpload.php getFileRecord() file_id lookup = Replace $this->getRelationModel()->find(post('file_id')) with $this->getRelationObject()->withDeferred($this->sessionKey)->find(post('file_id'))
  4. Configuration

    If you cannot upgrade immediately, update FileUpload.php onSortAttachments() to intersect/filter posted sortOrder ids to ids that belong to the widget's relation (scoped to withDeferred($this->sessionKey)) before calling setSortableOrder().

    modules/backend/formwidgets/FileUpload.php onSortAttachments() sortOrder scoping = Filter the posted sortOrder ids to those returned by $this->getRelationObject()->withDeferred($this->sessionKey)->pluck($keyName) before calling setSortableOrder()

Event History

Aug 20, 2026
Advisory Published
via GitHub·06:39 PM
Data Sourced
via GitHub·06:39 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Who can exploit this issue?

Any authenticated backend user who can access a form containing a fileupload field can exploit it. This includes the built-in My Account avatar field, which does not require a specific backend permission.

2

What access does an attacker need to target another attachment?

The attacker needs to submit an attacker-controlled file_id value to a reachable backend fileupload form. The file does not need to belong to that form, its parent record, or its deferred-binding session because the lookup is performed against the global system_files table.

3

What other files can be affected?

An attacker is not limited to other users' avatars. Because attachments use the shared System\Models\File model and system_files table, any attachment on any model can be referenced by its ID.

4

What changes can an attacker make to a targeted attachment?

They can modify the attachment's title and description through onSaveAttachmentConfig. They can also change its sort_order through onSortAttachments.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203