{"id":"CVE-2026-41247","aliases":["GHSA-8q4h-8crm-5cvc"],"url":"https://o3.security/vulnerability/CVE-2026-41247","summary":"elFinder: Command injection in resize background color parameter when using ImageMagick CLI","details":"### Severity\n**High**  \n`bg` can be injected into shell command construction, leading to possible RCE in affected configurations.\n\n### Summary\n\nelFinder contains a command injection vulnerability in the `resize` command.\n\nThe `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.\n\nThis issue affects configurations where:\n- the `resize` command is enabled,\n- image processing uses the ImageMagick CLI backend, and\n- the vulnerable code paths are reachable.\n\n\n### Impact\n\nAn attacker may execute arbitrary OS commands with the privileges of the web server process.\n\nImpact depends on server configuration, enabled commands, backend image library selection, and surrounding deployment controls.\n\n\n### Affected versions\n\nAffected: all versions before 2.1.66\nPatched: 2.1.67\n\n\n### Details\n\nThe vulnerable flow is:\n\n1. The `resize` command accepts the `bg` parameter from the request.\n2. The parameter is passed into volume resize handling.\n3. In ImageMagick CLI code paths, the value is interpolated into shell command strings.\n4. Because the value is not safely constrained and escaped, shell metacharacters may be injected.\n\nThe issue was addressed by:\n- validating `bg` against a strict allowlist of supported color formats, and\n- safely escaping the value before it is passed into CLI command construction.\n\n\n### Workarounds\n\nPossible mitigations for users who cannot upgrade immediately:\n\n- disable the `resize` command if not required,\n- avoid using the ImageMagick CLI backend for image processing,\n- restrict access to trusted users only.\n\nUpgrading to the patched release is strongly recommended.\n\n\n### Credits\n\nThanks to Lin, WeiChi and Drew Webber for the responsible disclosure.","published":"2026-04-23T18:47:57.558Z","modified":"2026-08-12T03:51:18.294283944Z","cvss":null,"epss":{"score":0.01569,"percentile":0.74094,"asOf":"2026-09-16"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"Packagist","name":"studio-42/elfinder","fixedVersion":"2.1.67"}],"fix":null,"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/41xxx/CVE-2026-41247.json"},{"type":"ADVISORY","url":"https://github.com/Studio-42/elFinder/security/advisories/GHSA-8q4h-8crm-5cvc"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41247"},{"type":"PACKAGE","url":"https://github.com/Studio-42/elFinder"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:18.294283944Z"}}