CVE-2021-23814: Unisharp/laravel filemanager Unrestricted Upload Of File With Vulnerability

MODERATE
Advisory Identifier: GHSA-f8x6-m9f5-ffp8
CVSS 6.7
CWE-434
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2021-23814
GHSA Identifier GHSA-f8x6-m9f5-ffp8
Severity MODERATE
CVSS v3.1 Base Score 6.7
CWE Classification CWE-434: Unrestricted Upload of File with Dangerous Type
Affected Product Unisharp/laravel filemanager
Package Ecosystem Packagist
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability Low (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.

unisharp/laravel-filemanager fixed: 2.6.2
Upgrade unisharp/laravel-filemanager to 2.6.2
Verify Direct and Transitive Dependencies

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

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](https://unisharp.github.io/laravel-filemanager/configfolder-categories).

CVE-2021-23814 Affected Unisharp/laravel filemanager Versions

1 component(s)
Fixed Versions:
2.6.2
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?
CVE-2021-23814 is a security vulnerability in Unisharp/laravel filemanager involving Unrestricted Upload of File with Dangerous Type in unisharp/laravel-filemanager under CWE-434: Unrestricted Upload of File with Dangerous Type.
Which Unisharp/laravel filemanager versions are affected?
Affected versions include releases prior to 2.6.2 across affected packages: unisharp/laravel-filemanager.
What version fixes CVE-2021-23814?
Upgrading to 2.6.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is unisharp/laravel-filemanager affected?
Yes, unisharp/laravel-filemanager is affected in releases prior to 2.6.2. Upgrade your dependency to 2.6.2 or later.
What is the CVSS score of CVE-2021-23814?
CVE-2021-23814 has a CVSS v3.1 base score of 6.7 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:L.
What CWE is associated with CVE-2021-23814?
CVE-2021-23814 is classified under CWE-434: Unrestricted Upload of File with Dangerous Type (The product allows the upload or transfer of dangerous file types that are automatically processed within its environment.).
How can I check Packagist dependencies for CVE-2021-23814?
Run the dependency tree command: 'inspect dependencies for unisharp/laravel-filemanager'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}