High

elFinder: Command injection in resize background color parameter when using ImageMagick CLI

  • Disclosed: 17.04.2026
  • Updated: 11.10.2026 10:22

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 resize command 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:

  1. The resize command accepts the bg parameter from the request.
  2. The parameter is passed into volume resize handling.
  3. In ImageMagick CLI code paths, the value is interpolated into shell command strings.
  4. Because the value is not safely constrained and escaped, shell metacharacters may be injected.

The issue was addressed by:

  • validating bg against 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 resize command 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.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Composer package studio-42/elfinder < 2.1.67 2.1.67

References

CVSS score 9.8/10
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weakness (CWE)
CWE-78
Platform
Composer
Package
studio-42/elfinder
Disclosed
17.04.2026
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-8q4h-8crm-5cvc - CC BY 4.0

Vulnerability history: studio-42/elfinder

All published vulnerabilities of this package (Composer package), newest first. Shows whether this is a one-off slip or a package that needs watching.

All (18) in the archive
Total entries
18
First → latest
06.2021 09.2026
Without a fix
2
Exploited in attacks
0

Severity breakdown

  • Critical 7
  • High 8
  • Medium 3

Disclosures per year

  1. 2021: 2
  2. 2022: 9
  3. 2023: 1
  4. 2024: 1
  5. 2025: 0
  6. 2026: 5
Severity:
  1. elFinder: Command injection in resize background color parameter when using ImageMagick CLI this entry
    High · 9.8 CVE-2026-41247 < 2.1.67 2.1.67
  2. High · 9.8 CVE-2024-38909 <= 2.1.64 no fix
  3. Critical · 9.8 CVE-2019-9194 < 2.1.48 2.1.48
  4. Critical · 9.1 CVE-2018-9110 >= 2.1.12, < 2.1.37 2.1.37
  5. Critical · 9.1 CVE-2018-9109 < 2.1.36 2.1.36
  6. High · 7.7 CVE-2019-6257 < 2.1.49 2.1.49
  7. Critical · 9.8 CVE-2022-27115 < 2.1.61 2.1.61
  8. Critical · 9.8 CVE-2021-43421 >= 2.0.4, < 2.1.60 2.1.60
  9. Critical · 9.1 CVE-2022-26960 < 2.1.61 2.1.61
  10. Critical · 9.8 CVE-2021-32682 < 2.1.59 2.1.59
  11. High · 8.1 CVE-2021-23394 < 2.1.58 2.1.58

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.