spatie/laravel-medialibrary security advisory
CVE-2026-48557: Spatie Laravel Media Library contains a file upload restriction bypass
CVE-2026-48557 is a high-severity security vulnerability in the PHP package spatie/laravel-medialibrary (CVSS 8.8), published 29 May 2026. It is fixed in 11.23.0; earlier versions are affected. Exploiting it needs a low-privilege user account.
high 8.8 published 2026-05-29 · updated 2026-10-08
- Affected versions
- < 11.23.0
- Fixed in
- 11.23.0
- Newest release
- 11.23.11
- Severity
- High · CVSS 8.8
- Type
- Security issue
CWE-184 - Exploited in the wild
- Not on the CISA KEV list
checked 2026-11-04
Is your spatie/laravel-medialibrary version affected?
Who can exploit CVE-2026-48557
- Access: A normal, low-privilege user account in the app.
CVSS vector (scored by VulnCheck): CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
How to fix CVE-2026-48557 in spatie/laravel-medialibrary
- Find the installed version:
composer show spatie/laravel-medialibrary. If you never required it yourself,composer why spatie/laravel-medialibraryshows which package pulls it in. - Update it:
composer update spatie/laravel-medialibrary --with-all-dependencies. You need 11.23.0 or newer. - If Composer will not go that high, your composer.json constraint is holding it back. Widen it (for example
"spatie/laravel-medialibrary": "^11.23.0"if you can take that version), or upgrade the package that requires it. - Run
composer audit. It reads the same advisory data and should no longer list CVE-2026-48557. - Commit composer.lock and deploy it. On the server, run
composer install --no-devfrom the lock file, notcomposer update.
If you cannot upgrade yet
- If your app does not use the affected feature, note that in your audit, but still plan the upgrade.
The CVE-2026-48557 advisory
Spatie Laravel Media Library before version 11.23.0 contains a file upload restriction bypass in FileAdder::defaultSanitizer(). The sanitizer checks only the final filename suffix, allowing double-extension filenames such as shell.php.jpg to bypass the blocklist, with pathinfo() preserving inner .php stems in saved filenames. The blocklist also omits executable extensions including .php6, .shtml, and .htaccess. The double-extension bypass requires a legacy Apache AddHandler configuration to achieve PHP execution; the incomplete blocklist bypass does not.
References
- GitHub advisory GHSA-3ggm-c5m7-hfv5 github.com
- Vulncheck security advisory www.vulncheck.com
- Fix commit 608ea03 github.com
- Pull request #3939 github.com
- Release 11.23.0 github.com
Other spatie/laravel-medialibrary advisories
- medium CVE-2026-48555: Spatie Laravel Media Library contains a server-side request forgery vulnerability 2026-05-29
Related
Need help patching or upgrading? Laskyr does PHP and Laravel security fixes and upgrades. Tell us what you run and we reply with a plan and a price.
Ask about a fixWhere this data comes from
- Affected and fixed versions: the Packagist security advisories API (GitHub Advisory Database and FriendsOfPHP), the same data
composer audituses. Synced 2026-11-03. - Description, score, weakness and references: NIST National Vulnerability Database (NVD), checked 2026-11-04. This product uses data from the NVD API but is not endorsed or certified by the NVD.
- Exploited-in-the-wild status: the CISA Known Exploited Vulnerabilities catalog, checked 2026-11-04.
- Compiled by Daniel Lasek at Laskyr from the sources above. The summary, “who can exploit it”, “how to fix it” and hardening sections are our plain-English reading of the record and are generated from it. The quoted description is the record's own text. Spot an error? Tell us.