Unrestricted Upload of File with Dangerous Type in unisharp/laravel-filemanager
Published 6 Jan 2022 · Updated 18 Jun 2025
Is your project on an affected unisharp/laravel-filemanager?
Look after several Laravel or PHP apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected package
- Affected
- <2.6.2
- Fixed in
- 2.6.2
composer require unisharp/laravel-filemanager:^2.6.2Details
This affects the package unisharp/laravel-filemanager prior to version 2.6.2. The upload() function does not sufficiently validate the file type when uploading.
An attacker may be able to reproduce the following steps:
- Install a package with a web Laravel application.
- Navigate to the Upload window
- Upload an image file, then capture the request
- Edit the request contents with a malicious file (webshell)
- Enter the path of file uploaded on URL
- Remote Code Execution
Note: Prevention for bad extensions can be done by using a whitelist in the config file(lfm.php). Corresponding document can be found in the here.
Is GHSA-f8x6-m9f5-ffp8 in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected unisharp/laravel-filemanager, and gives you the command that fixes it.
More advisories for unisharp/laravel-filemanager
- HighCVE-2024-21546UniSharp Laravel Filemanager Code Injection vulnerability · 18 Dec 2024
- MediumCVE-2022-40734UniSharp Laravel Filemanager directory traversal vulnerability · 15 Sept 2022
References
- Advisorynvd.nist.gov/vuln/detail/CVE-2021-23814
- Linkgithub.com/UniSharp/laravel-filemanager/issues/1113#issuecomment-1812092975
- Linkgithub.com/UniSharp/laravel-filemanager/commit/bd84899ce65a7f193e676dd8444e424fa50f64fa
- Packagegithub.com/UniSharp/laravel-filemanager
- Linkgithub.com/UniSharp/laravel-filemanager/blob/master/src/Controllers/UploadController.php#L26
- Linkgithub.com/UniSharp/laravel-filemanager/blob/master/src/Controllers/UploadController.php%23L26
- Linksnyk.io/vuln/SNYK-PHP-UNISHARPLARAVELFILEMANAGER-1567199
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.