CVE-2021-23814 Unrestricted Upload of File with Dangerous Type in unisharp/laravel-filemanager
Attackers can upload malicious files to achieve remote code execution in applications using the unisharp/laravel-filemanager package.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2021-23814?
CVE-2021-23814 is a medium-severity vulnerability in unisharp/laravel-filemanager, published on 17 Dec 2021. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Official description
This affects versions of the package unisharp/laravel-filemanager before 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: 1. Install a package with a web Laravel application. 2. Navigate to the Upload window 3. Upload an image file, then capture the request 4. Edit the request contents with a malicious file (webshell) 5. 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 [here](https://unisharp.github.io/laravel-filemanager/configfolder-categories).
Which versions are affected by CVE-2021-23814?
2 open source packages ship an affected version, including unisharp/laravel-filemanager. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
unisharp/laravel-filemanager Packagist | All versions | 2.6.2 |
unisharp/laravel-filemanager Packagist | All versions | 2.6.2 |
Products include Unisharp Laravel-Filemanager.
How do I fix CVE-2021-23814?
Upgrade unisharp/laravel-filemanager to 2.6.2 or later.
Is CVE-2021-23814 being exploited?
There is no known exploitation of CVE-2021-23814 in the wild and no public exploit code.
Sources
Also known as GHSA-f8x6-m9f5-ffp8, SNYK-PHP-UNISHARPLARAVELFILEMANAGER-1567199.