CVE-2026-54256: CSRF
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
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.13 - Upgrade
Upgrade
wintercms/winterto a version that resolves this vulnerability.Fixed in v1.2.13 - Configuration
If you cannot upgrade immediately, scope the `file_id` lookup to the widget’s relation (including deferred-binding session) by applying the specified code change in `getFileRecord()`.
modules/backend/formwidgets/FileUpload.php FileUpload::getFileRecord() file lookup method = Replace `$this->getRelationModel()->find(post('file_id'))` with `$this->getRelationObject()->withDeferred($this->sessionKey)->find(post('file_id'))` - Configuration
If you cannot upgrade immediately, in `onSortAttachments()` intersect/filter the posted attachment ids to the ids that belong to the widget’s relation (with deferred-binding session) prior to calling `setSortableOrder()`.
modules/backend/formwidgets/FileUpload.php FileUpload::onSortAttachments() sortOrder id scoping = Filter posted `sortOrder` ids to those returned by `$this->getRelationObject()->withDeferred($this->sessionKey)->pluck($keyName)` before calling `setSortableOrder()`
Event History
Frequently Asked Questions
Which users can exploit this issue?
Any authenticated backend user who can access a form with a fileupload field can exploit it. The built-in My Account avatar field is specifically exposed and does not require a particular backend permission.
Is the impact limited to avatar attachments?
No. Attachment IDs are resolved against the shared system_files table without verifying ownership or relation scope, so an attacker can reference attachments belonging to other users or to any model.
What changes can an attacker make to another attachment?
An attacker can modify an attachment's title and description, and can change its sort order. The unscoped attachment lookup is also used by the attachment configuration loading and removal handlers.