SA-CONTRIB-2026-362: XSS
The File Download module provides a custom field formatter that allows users to download file and image entities directly. It also provides an optional sub-module to count and display file downloads in Views (similar to how the core statistics module tracks content views). The module does not properly sanitize filenames, allowing stored cross-site scripting (XSS) attacks. An attacker with file upload permissions could upload a file with a malicious filename, which would then execute in the browser of any user viewing the field.
Credit
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
composer/drupal/file_downloadto a version that resolves this vulnerability.Fixed in 2.0.2
Event History
Frequently Asked Questions
What access does an attacker need to exploit this issue?
The attacker needs permission to upload files. They can upload a file with a malicious filename that is later rendered by the affected field formatter.
Who is exposed to the malicious payload?
Any user who views the field containing the uploaded file may have the script execute in their browser.