{"id":"CVE-2021-23394","aliases":["EUVD-2021-1383","GHSA-qm58-cvvm-c5qr","SNYK-PHP-STUDIO42ELFINDER-1290554"],"status":"published","title":"Remote Code Execution (RCE)","description":"The package studio-42/elfinder before 2.1.58 are vulnerable to Remote Code Execution (RCE) via execution of PHP code in a .phar file. NOTE: This only applies if the server parses .phar files as PHP.","severity":{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-11","score":0.18935,"percentile":0.97335,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":true,"fix_available":true},"cwes":["CWE-434"],"published":"2021-06-13T11:05:11Z","modified":"2026-10-20T10:54:32Z","exploits":[{"source":"pocgithub","id":"0xnemian/CVE-2021-23394","title":"0xnemian/CVE-2021-23394","date":"2025-11-30","url":"https://github.com/0xnemian/CVE-2021-23394"},{"source":"nuclei","id":"CVE-2021-23394","title":"elFinder \u003c 2.1.58 - Remote Code Execution","type":"detection template","url":"https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2021/CVE-2021-23394.yaml"}],"fixes":[{"ecosystem":"Packagist","package":"studio-42/elfinder","fixed_in":["2.1.58"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"Packagist","package":"studio-42/elfinder","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.1.58"}]}]},{"source":"osv","ecosystem":"Packagist","package":"studio-42/elfinder","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.1.58"}]}],"versions":["2.0.3","2.0.4","2.0.5","2.0.6","2.0.7","2.0.8","2.0.9","2.1.0","2.1.1","2.1.10","2.1.11","2.1.12","2.1.13","2.1.14","2.1.15","2.1.16","2.1.17","2.1.18","2.1.19","2.1.2","2.1.20","2.1.21","2.1.22","2.1.23","2.1.24","2.1.25","2.1.26","2.1.27","2.1.28","2.1.29","2.1.3","2.1.30","2.1.31","2.1.32","2.1.33","2.1.34","2.1.35","2.1.36","2.1.37","2.1.38","2.1.39","2.1.4","2.1.40","2.1.41","2.1.42","2.1.43","2.1.44","2.1.45","2.1.46","2.1.47","2.1.48","2.1.49","2.1.5","2.1.50","2.1.51","2.1.52","2.1.53","2.1.54","2.1.55","2.1.56","2.1.57","2.1.6","2.1.7","2.1.8","2.1.9"]}],"products":[{"vendor":"std42","product":"elfinder"}],"references":[{"url":"https://snyk.io/vuln/SNYK-PHP-STUDIO42ELFINDER-1290554","tags":["x_refsource_MISC","x_transferred","Third Party Advisory","advisory","web"]},{"url":"https://github.com/Studio-42/elFinder","tags":["x_refsource_MISC","x_transferred","Third Party Advisory","advisory","package"]},{"url":"https://github.com/Studio-42/elFinder/issues/3295","tags":["x_refsource_MISC","x_transferred","Exploit","Issue Tracking","Patch","Third Party Advisory","fix","web"]},{"url":"https://github.com/Studio-42/elFinder/commit/75ea92decc16a5daf7f618f85dc621d1b534b5e1","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web"]},{"url":"https://blog.sonarsource.com/elfinder-case-study-of-web-file-manager-vulnerabilities/","tags":["x_refsource_MISC","x_transferred","Exploit","Third Party Advisory","evidence"]},{"url":"https://github.com/Studio-42/elFinder/security/advisories/GHSA-qm58-cvvm-c5qr","tags":["web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-23394","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-qm58-cvvm-c5qr"},{"url":"https://blog.sonarsource.com/elfinder-case-study-of-web-file-manager-vulnerabilities","tags":["web"]}],"sources":{"cve":[{"id":"CVE-2021-23394","title":"Remote Code Execution (RCE)","description":"The package studio-42/elfinder before 2.1.58 are vulnerable to Remote Code Execution (RCE) via execution of PHP code in a .phar file. NOTE: This only applies if the server parses .phar files as PHP.","status":"published","published":"2021-06-13T11:05:11.816Z","modified":"2024-09-16T22:30:47.517Z","cvss":[{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"high","assessor":"cna"}],"updated_at":"2026-11-02T14:33:00.488332Z"}],"euvd":[{"id":"EUVD-2021-1383","description":"The package studio-42/elfinder before 2.1.58 are vulnerable to Remote Code Execution (RCE) via execution of PHP code in a .phar file. NOTE: This only applies if the server parses .phar files as PHP.","status":"published","published":"2021-06-13T11:05:11Z","modified":"2024-09-16T22:30:47Z","cvss":[{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-03T00:55:02.424132Z"}],"ghsa":[{"id":"GHSA-qm58-cvvm-c5qr","title":"elFinder unsafe upload filtering leading to remote code execution","description":"### Impact\n\nBefore elFinder 2.1.58, the upload filter did not disallow the upload of `.phar` files. As several Linux distributions are now shipping Apache configured in a way it will process these files as PHP scripts, attackers could gain arbitrary code execution on the server hosting the PHP connector (even in minimal configuration).\n\n### Patches\n\nThe issue has been addressed with https://github.com/Studio-42/elFinder/commit/75ea92decc16a5daf7f618f85dc621d1b534b5e1, associating `.phar` files to the right MIME type. Unless explicitly allowed in the configuration, such files cannot be uploaded anymore. This patch is part of the last release of elFinder, 2.1.58.\n\n### Workarounds\n\nIf you can't update to 2.1.58, make sure your connector is not exposed without authentication.\n\n### Important tips\n\nServer-side scripts can often be created as text files. Currently, elFinder has an appropriate MIME type set for file extensions that are generally runnable on a web server.\n\nHowever, the server has various settings. In some cases, the executable file may be judged as \"text/plain\". Therefore, elFinder installers should understand the extensions that can be executed on the web server where elFinder is installed, and check if there are any missing items in the elFinder settings.\n\nThe elFinder PHP connector has an option \"additionalMimeMap\" that specifies the MIME type for each extension. See [#3295(comment)](https://github.com/Studio-42/elFinder/issues/3295#issuecomment-853042139) for more information.\n\n### References\n\n- https://snyk.io/vuln/composer:studio-42%2Felfinder\n- https://github.com/Studio-42/elFinder/issues/3295\n- Further technical details will be disclosed on https://blog.sonarsource.com/tag/security after some time.\n\n### For more information\n\nIf you have any questions or comments about this advisory, you can contact:\n- The original reporters, by sending an email to  support [at] snyk.io or vulnerability.research [at] sonarsource.com;\n- The maintainers, by opening an issue on this repository.","status":"published","published":"2021-06-15T15:51:02Z","modified":"2023-01-29T05:02:54Z","cvss":[{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"cwes":["CWE-434"],"updated_at":"2026-11-02T14:36:25.835323Z"}],"nvd":[{"id":"CVE-2021-23394","description":"The package studio-42/elfinder before 2.1.58 are vulnerable to Remote Code Execution (RCE) via execution of PHP code in a .phar file. NOTE: This only applies if the server parses .phar files as PHP.","status":"published","published":"2021-06-13T11:15:14.29Z","modified":"2026-06-17T03:38:40.937Z","cvss":[{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"high","assessor":"secondary"},{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"primary"},{"version":"2.0","score":6.8,"vector":"AV:N/AC:M/Au:N/C:P/I:P/A:P","level":"medium","assessor":"primary"}],"cwes":["CWE-434"],"updated_at":"2026-11-02T14:06:54.892562Z"}],"osv":[{"id":"CVE-2021-23394","description":"The package studio-42/elfinder before 2.1.58 are vulnerable to Remote Code Execution (RCE) via execution of PHP code in a .phar file. NOTE: This only applies if the server parses .phar files as PHP.","status":"published","published":"2021-06-13T11:15:14.29Z","modified":"2026-10-20T10:54:32.048672443Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T15:44:18.367807Z"},{"id":"GHSA-qm58-cvvm-c5qr","title":"elFinder unsafe upload filtering leading to remote code execution","description":"### Impact\n\nBefore elFinder 2.1.58, the upload filter did not disallow the upload of `.phar` files. As several Linux distributions are now shipping Apache configured in a way it will process these files as PHP scripts, attackers could gain arbitrary code execution on the server hosting the PHP connector (even in minimal configuration).\n\n### Patches\n\nThe issue has been addressed with https://github.com/Studio-42/elFinder/commit/75ea92decc16a5daf7f618f85dc621d1b534b5e1, associating `.phar` files to the right MIME type. Unless explicitly allowed in the configuration, such files cannot be uploaded anymore. This patch is part of the last release of elFinder, 2.1.58.\n\n### Workarounds\n\nIf you can't update to 2.1.58, make sure your connector is not exposed without authentication.\n\n### Important tips\n\nServer-side scripts can often be created as text files. Currently, elFinder has an appropriate MIME type set for file extensions that are generally runnable on a web server.\n\nHowever, the server has various settings. In some cases, the executable file may be judged as \"text/plain\". Therefore, elFinder installers should understand the extensions that can be executed on the web server where elFinder is installed, and check if there are any missing items in the elFinder settings.\n\nThe elFinder PHP connector has an option \"additionalMimeMap\" that specifies the MIME type for each extension. See [#3295(comment)](https://github.com/Studio-42/elFinder/issues/3295#issuecomment-853042139) for more information.\n\n### References\n\n- https://snyk.io/vuln/composer:studio-42%2Felfinder\n- https://github.com/Studio-42/elFinder/issues/3295\n- Further technical details will be disclosed on https://blog.sonarsource.com/tag/security after some time.\n\n### For more information\n\nIf you have any questions or comments about this advisory, you can contact:\n- The original reporters, by sending an email to  support [at] snyk.io or vulnerability.research [at] sonarsource.com;\n- The maintainers, by opening an issue on this repository.","status":"published","published":"2021-06-15T15:51:02Z","modified":"2026-07-08T06:49:30.989304015Z","cvss":[{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"cwes":["CWE-434"],"updated_at":"2026-11-02T15:46:54.760124Z"}]}}
