Skip to content

Laravel Backpack CRUD: HasUploadFields keeps the attacker-supplied file extension — public-disk uploads of `shell.php` reach the webserver

Moderate severity GitHub Reviewed Published Jun 15, 2026 in Laravel-Backpack/CRUD • Updated Aug 20, 2026

Package

composer backpack/crud (Composer)

Affected versions

>= 6.0.0, < 6.8.14
>= 7.0.0, < 7.0.38

Patched versions

6.8.14
7.0.38

Description

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.

References

@tabacitu tabacitu published to Laravel-Backpack/CRUD Jun 15, 2026
Published to the GitHub Advisory Database Aug 20, 2026
Reviewed Aug 20, 2026
Last updated Aug 20, 2026

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
High
Privileges required
High
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H

EPSS score

Weaknesses

Unrestricted Upload of File with Dangerous Type

The product allows the upload or transfer of dangerous file types that are automatically processed within its environment. Learn more on MITRE.

CVE ID

CVE-2026-54177

GHSA ID

GHSA-8q2w-pv9p-mjvc

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.