GHSA-3277-H8G9-QJ5F
Vulnerability from github – Published: 2026-08-20 18:39 – Updated: 2026-08-20 18:39Impact
The backend FileUpload form widget trusted an attacker-controlled file_id POST parameter when resolving the attachment it operates on. The lookup (FileUpload::getFileRecord()) resolved the posted id against the global system_files 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
titleanddescriptionviaonSaveAttachmentConfig, and - change its
sort_orderviaonSortAttachments(which passed posted ids straight tosetSortableOrder(), an unscopedUPDATE ... WHERE id = ?).
The same unscoped lookup is reached by onLoadAttachmentConfig, onSaveAttachmentConfig, and onRemoveAttachment. Because all attachments share the single System\Models\File model and system_files 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 file_id 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 throughgetRelationObject()->withDeferred($this->sessionKey)->find(...)rather than the global file model. This coversonLoadAttachmentConfig,onSaveAttachmentConfig, andonRemoveAttachment.onSortAttachments()intersects the posted ids with the ids that actually belong to the relation before callingsetSortableOrder().
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:
- In
getFileRecord(), replace$this->getRelationModel()->find(post('file_id'))with$this->getRelationObject()->withDeferred($this->sessionKey)->find(post('file_id')). - In
onSortAttachments(), filter the postedsortOrderids to those returned by$this->getRelationObject()->withDeferred($this->sessionKey)->pluck($keyName)before callingsetSortableOrder().
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 1.2.12"
},
"package": {
"ecosystem": "Packagist",
"name": "winter/wn-backend-module"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.2.13"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-54256"
],
"database_specific": {
"cwe_ids": [
"CWE-284",
"CWE-639"
],
"github_reviewed": true,
"github_reviewed_at": "2026-08-20T18:39:56Z",
"nvd_published_at": null,
"severity": "MODERATE"
},
"details": "### Impact\n\nThe backend `FileUpload` form widget trusted an attacker-controlled `file_id` POST parameter when resolving the attachment it operates on. The lookup (`FileUpload::getFileRecord()`) resolved the posted id against the global `system_files` table without verifying that the file belonged to the widget\u0027s own relation, parent record, or deferred-binding session.\n\nAny authenticated backend user who can reach a form containing a `fileupload` field \u2014 including the built-in **My Account** avatar field, which requires no specific backend permission \u2014 could therefore target a `System\\Models\\File` record belonging to another user or record and:\n\n- modify its `title` and `description` via `onSaveAttachmentConfig`, and\n- change its `sort_order` via `onSortAttachments` (which passed posted ids\n straight to `setSortableOrder()`, an unscoped `UPDATE ... WHERE id = ?`).\n\nThe same unscoped lookup is reached by `onLoadAttachmentConfig`, `onSaveAttachmentConfig`, and `onRemoveAttachment`. Because all attachments share the single `System\\Models\\File` model and `system_files` table, an attacker was not limited to other users\u0027 avatars \u2014 any attachment on any model could be referenced by id. Attachment ids are sequential integers and are easily enumerated.\n\nThe confirmed impact is unauthorized integrity modification of arbitrary attachment metadata and ordering.\n\nCSRF 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.\n\n### Patches\n\nThe `FileUpload` widget now scopes every `file_id` lookup to the widget\u0027s 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:\n\n- `getFileRecord()` resolves the id through `getRelationObject()-\u003ewithDeferred($this-\u003esessionKey)-\u003efind(...)` rather than the global file model. This covers `onLoadAttachmentConfig`, `onSaveAttachmentConfig`, and `onRemoveAttachment`.\n- `onSortAttachments()` intersects the posted ids with the ids that actually belong to the relation before calling `setSortableOrder()`.\n\nThis security issue has been fixed as of **v1.2.13** (commit [`9cb0ae5f9d837db141ab111c6a7de8eed9603d25`](https://github.com/wintercms/winter/commit/9cb0ae5f9d837db141ab111c6a7de8eed9603d25)).\n\n### Workarounds\n\nThere is no supported workaround other than upgrading. If you cannot upgrade immediately, you may apply the fix manually in `modules/backend/formwidgets/FileUpload.php`:\n\n1. In `getFileRecord()`, replace `$this-\u003egetRelationModel()-\u003efind(post(\u0027file_id\u0027))` with `$this-\u003egetRelationObject()-\u003ewithDeferred($this-\u003esessionKey)-\u003efind(post(\u0027file_id\u0027))`.\n2. In `onSortAttachments()`, filter the posted `sortOrder` ids to those returned by `$this-\u003egetRelationObject()-\u003ewithDeferred($this-\u003esessionKey)-\u003epluck($keyName)` before calling `setSortableOrder()`.",
"id": "GHSA-3277-h8g9-qj5f",
"modified": "2026-08-20T18:39:56Z",
"published": "2026-08-20T18:39:56Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/wintercms/winter/security/advisories/GHSA-3277-h8g9-qj5f"
},
{
"type": "WEB",
"url": "https://github.com/wintercms/winter/security/advisories/GHSA-qq9m-vfv4-pj5w"
},
{
"type": "WEB",
"url": "https://github.com/wintercms/winter/commit/9cb0ae5f9d837db141ab111c6a7de8eed9603d25"
},
{
"type": "PACKAGE",
"url": "https://github.com/wintercms/winter"
},
{
"type": "WEB",
"url": "https://github.com/wintercms/winter/releases/tag/v1.2.13"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N",
"type": "CVSS_V3"
}
],
"summary": "Winter: Authenticated IDOR in backend FileUpload widget allows cross-user access to attachment metadata"
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.