CVE-2026-54179: XSS

Published Aug 20, 2026
·
Updated

Summary

SingleBase64Image::uploadFiles — the uploader bound to image-typed fields via withFiles() — only verifies that the submitted value starts with the string data:image. The MIME subtype and the base64-decoded bytes are never inspected or validated. A related bug in FileNameGenerator causes the stored file to receive an extensionless filename, because mimecontenttype() returns false when given a data URI instead of a filesystem path.

The combination allows an authenticated admin to store a file of arbitrary type on the configured disk under a name without a recognizable extension.

Details

php // src/app/Library/Uploaders/SingleBase64Image.php if (Str::startsWith($value, 'data:image')) { // MIME subtype and decoded bytes are not validated $base64Image = Str::after($value, ';base64,'); $finalPath = $this->getPath() . $this->getFileName($value); Storage::disk($this->getDisk())->put($finalPath, base64decode($base64Image)); return $finalPath; }

// src/app/Library/Uploaders/Support/FileNameGenerator.php private function getExtensionFromFile(string|UploadedFile $file): string { return isa($file, UploadedFile::class, true) ? $file->extension() : Str::after(mimecontenttype($file), '/'); // returns false on data URIs → empty string }

The stored filename ends with a trailing dot and no extension.

Impact

An authenticated admin submitting a malicious payload to a Backpack image field stored with withFiles() can write arbitrary file content to the configured storage disk. Depending on server configuration and how stored files are served, this may lead to stored XSS or other unintended behavior when the file is later accessed.

Fix

The fix validates the declared MIME subtype against an allowlist, decodes the base64 payload, and verifies the actual file bytes with finfo before storing. The extension is derived from the detected MIME type rather than the data URI string. Applied in SingleBase64Image::uploadFiles and uploadRepeatableFiles; FileNameGenerator::getExtensionFromFile now rejects inputs that produce an empty extension.

Setting X-Content-Type-Options: nosniff on admin responses is a useful defense-in-depth complement.

Affected versions

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

Patched versions

- 6.8.14 - 7.0.38

Affected Software

2 affected componentsFixes available
composer/backpack/crud>=7.0.0<7.0.38
7.0.38
composer/backpack/crud>=6.0.0<6.8.14
6.8.14

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade composer/backpack/crud to a version that resolves this vulnerability.

    Fixed in 7.0.38
  2. Upgrade

    Upgrade composer/backpack/crud to a version that resolves this vulnerability.

    Fixed in 6.8.14
  3. Upgrade

    Upgrade Backpack SingleBase64Image uploader to a version that resolves this vulnerability.

    Fixed in 6.8.14
  4. Upgrade

    Upgrade Backpack SingleBase64Image uploader to a version that resolves this vulnerability.

    Fixed in 7.0.38
  5. Configuration

    Set header X-Content-Type-Options: nosniff on admin responses as defense-in-depth complement.

    HTTP responses (admin) X-Content-Type-Options = nosniff

Event History

Aug 20, 2026
Advisory Published
via GitHub·06:38 PM
Data Sourced
via GitHub·06:38 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Who can exploit this issue?

An authenticated administrator who can submit values to an image-typed field bound through withFiles() can exploit it. The affected upload path is SingleBase64Image::uploadFiles.

2

What does an attacker need to provide?

The submitted value only needs to begin with data:image. The MIME subtype and base64-decoded content are not validated, allowing arbitrary decoded file content to be stored.

3

Where are uploaded files written, and how are they named?

Files are written to the configured storage disk. Due to the filename-generation issue, files uploaded through this path receive extensionless names.

4

How can we assess whether our application uses the affected path?

Review image-typed fields configured with withFiles() and determine whether they use SingleBase64Image::uploadFiles. Also review the configured disk for extensionless files created through image upload workflows.

5

Which release references are provided for remediation review?

The provided references include Backpack CRUD releases 6.8.14 and 7.0.38. Review those release notes and the linked advisory when planning an update.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203