CVE-2026-81891: elFinder: ZIP extraction bypasses uploadDeny MIME filter allowing PHP file upload (RCE)
elFinder provides uploadDeny and uploadAllow options in its connector configuration to restrict which MIME types may be uploaded. When uploadDeny includes text/x-php, direct upload of .php, .phtml, and .phar files is correctly blocked. However, the extract command (ZIP decompression) internally calls checkExtractItems(), which invokes mimetypeInternalDetect() directly without passing the result through mimeTypeNormalize(). Because phtml, phar, and similar PHP-executable extensions are absent from mime.types, they are not resolved to text/x-php at the detection stage, causing the MIME filter to be silently bypassed. An attacker who is permitted to upload ZIP archives can therefore extract PHP-executable files into the web-accessible files/ directory. If the server is configured to execute the affected extension (e.g., .phtml, .phar) as PHP — which is the case in common Apache and Nginx deployments — this results in Remote Code Execution.
References
- github.com/Studio-42/elFinder/commit/191372c1bbebbd36fb55af79a84b9984861390ff
- github.com/Studio-42/elFinder/commit/dd73e702820c146a192969800ee674ecdb208365
- github.com/Studio-42/elFinder/releases/tag/2.1.70
- github.com/Studio-42/elFinder/security/advisories/GHSA-gxmj-r5rf-ggwq
- github.com/advisories/GHSA-gxmj-r5rf-ggwq
- nvd.nist.gov/vuln/detail/CVE-2026-81891
Code Behaviors & Features
Detect and mitigate CVE-2026-81891 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →