CVE-2021-23814: Unisharp/laravel filemanager Unrestricted Upload Of File With Vulnerability
MODERATECVE-2021-23814 is a MODERATE (CVSS 6.7) unrestricted upload of file with vulnerability (CWE-434: Unrestricted Upload of File with Dangerous Type) affecting Unisharp/laravel filemanager libraries in the Packagist ecosystem. The issue involves unrestricted upload of file with dangerous type in unisharp/laravel-filemanager. Remediation is available by upgrading affected packages to version 2.6.2.
CVE-2021-23814 at a Glance
Security Impact
CVSS: 6.7
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:L).
How to Fix CVE-2021-23814
To remediate this vulnerability, upgrade all affected Unisharp/laravel filemanager dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade unisharp/laravel-filemanager to 2.6.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for unisharp/laravel-filemanager
How to Check if You Are Affected
To determine whether your application is affected by CVE-2021-23814, inspect your project dependencies for Unisharp/laravel filemanager:
inspect dependencies for unisharp/laravel-filemanager
Analyze the terminal output to locate any version of Unisharp/laravel filemanager in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.6.2), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-434: Unrestricted Upload of File with Dangerous Type, where the product allows the upload or transfer of dangerous file types that are automatically processed within its environment. In Unisharp/laravel filemanager, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2021-23814 Affected Unisharp/laravel filemanager Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
unisharp/laravel-filemanager
|
Packagist |
< 2.6.2
|
2.6.2
|
References
Frequently Asked Questions
What is CVE-2021-23814?
Which Unisharp/laravel filemanager versions are affected?
What version fixes CVE-2021-23814?
Is unisharp/laravel-filemanager affected?
What is the CVSS score of CVE-2021-23814?
What CWE is associated with CVE-2021-23814?
How can I check Packagist dependencies for CVE-2021-23814?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-f8x6-m9f5-ffp8",
"modified" : "2024-04-22T19:10:22Z",
"published" : "2022-01-06T21:08:34Z",
"aliases" : [ "CVE-2021-23814" ],
"summary" : "Unrestricted Upload of File with Dangerous Type in unisharp/laravel-filemanager",
"details" : "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.\n\nAn attacker may be able to reproduce the following steps:\n- Install a package with a web Laravel application.\n- Navigate to the Upload window\n- Upload an image file, then capture the request\n- Edit the request contents with a malicious file (webshell)\n- Enter the path of file uploaded on URL\n- Remote Code Execution\n\n**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](https://unisharp.github.io/laravel-filemanager/configfolder-categories).",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "unisharp/laravel-filemanager"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.6.2"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-23814"
}, {
"type" : "WEB",
"url" : "https://github.com/UniSharp/laravel-filemanager/issues/1113#issuecomment-1812092975"
}, {
"type" : "WEB",
"url" : "https://github.com/UniSharp/laravel-filemanager/commit/bd84899ce65a7f193e676dd8444e424fa50f64fa"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/UniSharp/laravel-filemanager"
}, {
"type" : "WEB",
"url" : "https://github.com/UniSharp/laravel-filemanager/blob/master/src/Controllers/UploadController.php#L26"
}, {
"type" : "WEB",
"url" : "https://github.com/UniSharp/laravel-filemanager/blob/master/src/Controllers/UploadController.php%23L26"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-PHP-UNISHARPLARAVELFILEMANAGER-1567199"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-434" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-01-04T18:05:21Z",
"nvd_published_at" : "2021-12-17T20:15:00Z"
}
}