/

CVE-2026-81891

Severity:

HIGH RISK

(8.1)

Unrestricted Upload (CWE-434) in elFinder File Manager

CVE-2026-81891

Deferred

Vulnerability type

Category:

Unrestricted File Upload

CWE:

CWE-434

Impact:

Remote Code Execution

Severity:

HIGH RISK

(8.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A file extraction validation flaw in elFinder can allow an attacker with ZIP upload permission to place PHP-executable files in a web-accessible directory.

If the web server executes relevant PHP extensions, the attacker may achieve remote code execution through the extracted file.

Affected context

The issue occurs in elFinder deployments that permit ZIP uploads and extraction into a web-accessible files/ directory. It becomes risky when the server executes PHP-related extensions and MIME validation relies on incomplete extension mappings, allowing executable files to bypass upload-deny rules during extraction.

Exploit preconditions

  • Attack surface: elFinder's ZIP upload and extraction functionality
  • Required access: Permission to upload ZIP archives
  • Trigger point: Extraction of archive entries into the managed files directory
  • Why exploitation is possible: MIME detection does not apply normalization before the extraction allow check, so certain PHP extensions may evade rules intended to block PHP content

Why this happens

The vulnerability results from inconsistent MIME-type handling between file detection and policy enforcement. checkExtractItems() calls internal MIME detection without applying the normalization step that maps several PHP-related extensions to text/x-php. As a result, allowPutMime() may approve files that upload-deny rules would otherwise reject. This maps to CWE-434: Unrestricted Upload of File with Dangerous Type, because executable content can be placed in a web-accessible location without reliable type validation.

Potential impact

  • An attacker may execute arbitrary PHP code on the server
  • The web application and managed files may be compromised
  • Stored files or application data could be modified or deleted
  • Credentials and other server-side secrets could be exposed
  • The host may be used for lateral movement or further compromise

General mitigation guidance

Mitigation generally focuses on ensuring that archive extraction follows the same trusted validation rules as direct uploads.

Common defensive patterns include:

  • Applying canonical MIME and extension normalization before every allow or deny decision
  • Treating archive contents as untrusted input and validating each extracted entry
  • Storing uploaded and extracted files outside web-executable directories where feasible
  • Disabling script execution in upload and file-management directories
  • Allowlisting permitted file types instead of relying only on deny rules
  • Enforcing least-privilege permissions for the web server and managed storage
  • Preventing archive paths from bypassing destination and content policies

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis rules identifying inconsistent MIME normalization across upload and extraction paths
  • Code review checks for archive extraction that bypasses ordinary upload validation
  • Tests covering uncommon executable extensions and alternate MIME representations
  • Web-server policy checks confirming that upload directories cannot execute scripts
  • Monitoring for ZIP extraction followed by requests to newly created script-like files
  • Policy enforcement requiring allowlisted file types and non-executable storage locations

Automated security review tools may help identify dangerous file handling and archive-processing patterns.

Sources

SourceLink
github.comgithub.com/Studio-42/elFinder/commit/191372c1bbebbd36fb55af79a84b9984861390ff
github.comgithub.com/Studio-42/elFinder/commit/dd73e702820c146a192969800ee674ecdb208365
github.comgithub.com/Studio-42/elFinder/releases/tag/2.1.70
github.comgithub.com/Studio-42/elFinder/security/advisories/GHSA-gxmj-r5rf-ggwq

Frequently asked

questions

It can be remotely exploitable when elFinder is exposed through a web application, ZIP uploads are enabled, and the attacker has permission to upload archives.

Not necessarily. The key requirement is permission to upload and extract ZIP files through the affected elFinder functionality.

Ensure every extracted file passes canonical type validation, and keep uploaded content in a directory where the web server cannot execute scripts.

Use allowlisted file types, apply identical validation to direct uploads and archive contents, disable script execution in storage directories, and test uncommon executable extensions.

Find out what's already
exploitable in your codebase.