Laravel medialibrary: Spatie Laravel Media Library contains a file upload restriction bypass (CVE-2026-48557)
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.
AI Analysis
Technical Summary
The vulnerability in Spatie Laravel Media Library (before version 11.23.0) is due to insufficient sanitization in the FileAdder::defaultSanitizer() function. The sanitizer validates only the last file extension, enabling attackers to upload files with double extensions that bypass the blocklist. The blocklist also does not include some executable extensions such as .php6, .shtml, and .htaccess. Successful exploitation to execute PHP code depends on the presence of legacy Apache AddHandler configurations. This flaw permits bypassing file upload restrictions, potentially allowing malicious file uploads.
Potential Impact
This vulnerability allows attackers to bypass file upload restrictions and upload files with disallowed extensions by using double extensions or omitted executable extensions. If the server uses legacy Apache AddHandler configurations, this can lead to remote code execution via uploaded PHP files. The impact is high due to the potential for unauthorized code execution on affected systems.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, users should review and enhance file upload validation to check all file extensions, including double extensions and omitted executable types. Additionally, disabling legacy Apache AddHandler configurations can reduce the risk of exploitation.
Laravel medialibrary: Spatie Laravel Media Library contains a file upload restriction bypass (CVE-2026-48557)
Description
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.
CVSS v4.0
Affected software
pkg:composer/spatie/laravel-medialibraryRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in Spatie Laravel Media Library (before version 11.23.0) is due to insufficient sanitization in the FileAdder::defaultSanitizer() function. The sanitizer validates only the last file extension, enabling attackers to upload files with double extensions that bypass the blocklist. The blocklist also does not include some executable extensions such as .php6, .shtml, and .htaccess. Successful exploitation to execute PHP code depends on the presence of legacy Apache AddHandler configurations. This flaw permits bypassing file upload restrictions, potentially allowing malicious file uploads.
Potential Impact
This vulnerability allows attackers to bypass file upload restrictions and upload files with disallowed extensions by using double extensions or omitted executable extensions. If the server uses legacy Apache AddHandler configurations, this can lead to remote code execution via uploaded PHP files. The impact is high due to the potential for unauthorized code execution on affected systems.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, users should review and enhance file upload validation to check all file extensions, including double extensions and omitted executable types. Additionally, disabling legacy Apache AddHandler configurations can reduce the risk of exploitation.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2026-05-21T18:34:46.418Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
- Gcve Source
- db.gcve.eu
Threat ID: 6a19feb2e29bf47b500fc28b
Added to database: 05/29/2026, 21:01:38 UTC
Last enriched: 07/29/2026, 21:06:27 UTC
Last updated: 07/31/2026, 21:27:10 UTC
Views: 100
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.