GHSA-8q2w-pv9p-mjvc: Malicious File Upload
Summary
HasUploadFields (used via CrudTrait on Backpack-managed models) and the withFiles() uploader preserve the client-supplied file extension without validation. On installations using a public disk with php artisan storage:link, this allows an authenticated administrator to upload a file with a server-executable extension that the web server will pass to the PHP interpreter - if no MIME or other type of upload validation is present.
Details
The uploadFileToDisk and uploadMultipleFilesToDisk methods hash the filename stem but write the client-supplied extension to disk verbatim — no allowlist, blocklist, or MIME check is applied inside the trait itself.
The newer withFiles() path (via FileNameGenerator) resolves the extension from the file's MIME type rather than the client filename, but also does not block server-executable types.
Applications that follow the Backpack quickstart without adding explicit mimes: or mimetypes: validation rules in their form requests are affected.
Impact
An authenticated administrator with access to an upload-enabled CRUD panel, on a site using the public disk with web-accessible storage and no MIME type validation, can upload a server-executable file and achieve remote code execution.
Conditions required for exploitation:
- Authenticated admin access to a Backpack CRUD panel - An upload field with no mimes: / mimetypes: validation rule - The public disk in use (standard pattern for web-visible uploads) - php artisan storage:link in place - A web server + PHP-FPM stack (default on most hosts)
Fix
A denylist for server-executable extensions has been added to both HasUploadFields and FileNameGenerator. Image-typed fields now additionally enforce an allowlist. This is defence-in-depth — it does not replace application-level validation.
Recommended developer action
Review all upload fields and add explicit mimes: or mimetypes: validation in your form requests or field definitions. Refer to the Backpack field documentation for examples.
---
Reported by Vishal Shukla (@shukla304) via sechub.dev.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
composer/backpack/crudto a version that resolves this vulnerability.Fixed in 7.0.38 - Upgrade
Upgrade
composer/backpack/crudto a version that resolves this vulnerability.Fixed in 6.8.14 - Configuration
For every upload-enabled CRUD panel field (including those backed by `HasUploadFields` and the `withFiles()` uploader path), update the form request or field definition to include explicit `mimes:` or `mimetypes:` validation rules. This provides application-level defence-in-depth so server-executable uploads are rejected even when extensions are preserved.
Backpack CRUD (form requests / field definitions for upload fields) mimes / mimetypes validation rule = add explicit `mimes:` or `mimetypes:` validation for every upload field (no MIME validation means the field is affected) - Configuration
Update the Backpack-related upload logic so that a denylist for server-executable extensions is applied in both `HasUploadFields` and `FileNameGenerator` (as described in the fix).
Backpack upload handling (defence-in-depth logic) server-executable extension blocking (denylist) = ensure denylist is present in both `HasUploadFields` and `FileNameGenerator`
Event History
Frequently Asked Questions
Which deployments are exposed to practical code execution through this issue?
Exposure requires an upload-enabled Backpack CRUD panel accessible to an authenticated administrator, use of the public disk with web-accessible storage such as php artisan storage:link, and no explicit MIME or file-type validation in the form request. Applications using the Backpack quickstart without mimes: or mimetypes: validation rules are affected under those conditions.
What level of access does an attacker need?
An attacker must be an authenticated administrator who can use an upload-enabled CRUD panel. The issue does not describe exploitation by unauthenticated users.
What can be done if an update cannot be applied immediately?
Add explicit mimes: or mimetypes: validation rules to upload form requests, and prevent uploaded files from being stored in a web-accessible location. Ensure server-executable file types are not accepted or served to the PHP interpreter.
How can I determine whether my application is currently at risk?
Review upload-enabled CRUD form requests for explicit mimes: or mimetypes: rules. Also check whether uploads use the public disk and whether its storage path is web-accessible through a storage link or equivalent web-server configuration.