CVE-2026-41247: elFinder: Command injection in resize background color parameter when using ImageMagick CLI
Severity High bg can be injected into shell command construction, leading to possible RCE in affected configurations. Summary elFinder contains a command injection vulnerability in the resize command. The bg (background color) parameter is accepted from user input and passed through image resize/rotate processing.
Published Apr 17, 2026 · Updated May 6, 2026
Affected packages
studio-42/elfinder
- Ecosystem
- Composer (PHP)
- Affected
- < 2.1.67
- Fixed in
- 2.1.67
- Check
composer show studio-42/elfinder
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Severity
High bg can be injected into shell command construction, leading to possible RCE in affected configurations.
Summary
elFinder contains a command injection vulnerability in the resize command.
The bg (background color) parameter is accepted from user input and passed through image resize/rotate processing. In configurations that use the ImageMagick CLI backend, this value is incorporated into shell command strings without sufficient escaping. An attacker able to invoke the resize command with a crafted bg value may achieve arbitrary command execution as the web server process user.
This issue affects configurations where:
- the
resizecommand is enabled, - image processing uses the ImageMagick CLI backend, and
- the vulnerable code paths are reachable.
Impact
An attacker may execute arbitrary OS commands with the privileges of the web server process.
Impact depends on server configuration, enabled commands, backend image library selection, and surrounding deployment controls.
Affected versions
Affected: all versions before 2.1.66 Patched: 2.1.67
Details
The vulnerable flow is:
- The
resizecommand accepts thebgparameter from the request. - The parameter is passed into volume resize handling.
- In ImageMagick CLI code paths, the value is interpolated into shell command strings.
- Because the value is not safely constrained and escaped, shell metacharacters may be injected.
The issue was addressed by:
- validating
bgagainst a strict allowlist of supported color formats, and - safely escaping the value before it is passed into CLI command construction.
Workarounds
Possible mitigations for users who cannot upgrade immediately:
- disable the
resizecommand if not required, - avoid using the ImageMagick CLI backend for image processing,
- restrict access to trusted users only.
Upgrading to the patched release is strongly recommended.
Credits
Thanks to Lin, WeiChi and Drew Webber for the responsible disclosure.
Credited to mcdruid.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Composer (PHP) vulnerabilities
All Composer (PHP) entriesCVE-2026-81890
elFinder: CSRF in netmount allows forced FTP mounts and server-side FTP connections
medium5.4Sep 2, 2026CVE-2026-81889
elFinder: SSRF protection bypass via DNS rebinding in the `fsock_get_contents()` fallback
high8.6Aug 31, 2026CVE-2026-44521
elFinder MySQL has a SQL Injection in its Volume Driver (elFinderVolumeMySQL)
high8.8May 11, 2026CVE-2024-38909
Studio 42 elFinder vulnerable to Incorrect Access Control
high9.8No fixJul 30, 2024
