Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🐘
🐘 Packagist
Not in CISA KEV
CRITICAL severity

CVE-2021-23394 — elfinder

CRITICALFix: Studio-42/elFinder@75ea92d

CVE-2021-23394 is a critical-severity (CVSS 9.8) Unrestricted File Upload vulnerability in studio-42/elfinder. 2 public exploit references exist, so weaponization risk is real. A fix is available for studio-42/elfinder — see the affected versions and patch details below.

elFinder unsafe upload filtering leading to remote code execution

Also known asGHSA-qm58-cvvm-c5qrSNYK-PHP-STUDIO42ELFINDER-1290554
Published
Updated
Affected
1 pkg
Patched
1 / 1
Exploits
2 known
Exploitation data as of Oct 10, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

EPSS Exploitation Probability

via FIRST.org ↗
18.9%probability of exploitation in next 30 days
Moderate Risk0.00%
Lower risk than most CVEs97th percentile — riskier than 97% of all scored CVEsHighest risk
0.92%32.9%65.0%97.0%77.4%18.9%Apr 26Aug 26Oct 26

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

CVE-2021-23394 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.

Where this sits among everything scored

Of 385,738 CVEs with a current EPSS score, this one falls in the 10–50% band (highlighted). Counts from FIRST.org, log-scaled.

Real-World Exposure

1 pkg affected
🐘studio-42/elfinder

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects Packagist packages — download data is not available via public APIs for these ecosystems.

Description

Impact

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

Patches

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

Workarounds

If you can't update to 2.1.58, make sure your connector is not exposed without authentication.

Important tips

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

However, 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.

The elFinder PHP connector has an option "additionalMimeMap" that specifies the MIME type for each extension. See #3295(comment) for more information.

References

For more information

If you have any questions or comments about this advisory, you can contact:

  • The original reporters, by sending an email to support [at] snyk.io or vulnerability.research [at] sonarsource.com;
  • The maintainers, by opening an issue on this repository.

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
🐘Packagiststudio-42/elfinderall versions2.1.58composer require studio-42/elfinder:^2.1.58

Affected Products

1 product · 1 configurations
Application
elfinderstd42
< 2.1.58
range
Exploits & PoCs
2

Research use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for studio-42/elfinder, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update studio-42/elfinder to 2.1.58 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-23394 is resolved across your whole dependency graph.

  3. Workarounds

    Treat uploaded files as untrusted until proven otherwise: validate the actual content type rather than the supplied extension, store uploads outside the web root on a volume mounted without execute permission, and rename them to server-generated identifiers so an attacker cannot choose the path a request will later resolve.

How to detect CVE-2021-23394

A community-maintained Nuclei template exists for this CVE. You can scan for it directly:

nuclei -id cve-2021-23394 -u https://target
Template
elFinder < 2.1.58 - Remote Code Execution
Severity
high
Impact
Attackers can execute arbitrary PHP code on the server, potentially leading to full server compromise.
Remediation
Update to version 2.1.58 or later.

Template by ProjectDiscovery nuclei-templates (0xanis), MIT licensed. View the full template. Scan only systems you are authorised to test.

Frequently Asked Questions

### Impact Before 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). ### Patches The 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
O3 Security · Impact-Aware SCA

Is CVE-2021-23394 in your dependencies?

Find it across Packagist, including transitive dependencies.

CVE-2021-23394: elfinder RCE — Fixed in 2.1.58