CVE-2026-41247: elFinder Command Injection Vulnerability

HIGH
Advisory Identifier: GHSA-8q4h-8crm-5cvc
CVSS 9.8
CWE-78
Published
Advisory Summary

CVE-2026-41247 is a HIGH (CVSS 9.8) command injection vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting elFinder libraries in the Packagist ecosystem. The issue involves command injection in resize background color parameter when using imagemagick cli. Remediation is available by upgrading affected packages to version 2.1.67.

CVE-2026-41247 at a Glance

CVE Identifier CVE-2026-41247
GHSA Identifier GHSA-8q4h-8crm-5cvc
Severity HIGH
CVSS v3.1 Base Score 9.8
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product elFinder
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 9.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-41247

To remediate this vulnerability, upgrade all affected elFinder dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

studio-42/elfinder fixed: 2.1.67
Upgrade studio-42/elfinder to 2.1.67
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for studio-42/elfinder

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-41247, inspect your project dependencies for elFinder:

inspect dependencies for studio-42/elfinder

Analyze the terminal output to locate any version of elFinder in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.1.67), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In elFinder, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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

CVE-2026-41247 Affected elFinder Versions

1 component(s)
Fixed Versions:
2.1.67
Product / Package Ecosystem Affected Versions Fixed Version
studio-42/elfinder
Packagist
< 2.1.67
2.1.67

References

Frequently Asked Questions

What is CVE-2026-41247?
CVE-2026-41247 is a security vulnerability in elFinder involving Command injection in resize background color parameter when using ImageMagick CLI under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which elFinder versions are affected?
Affected versions include releases prior to 2.1.67 across affected packages: studio-42/elfinder.
What version fixes CVE-2026-41247?
Upgrading to 2.1.67 (or the latest patched release for your respective branch) resolves the vulnerability.
Is studio-42/elfinder affected?
Yes, studio-42/elfinder is affected in releases prior to 2.1.67. Upgrade your dependency to 2.1.67 or later.
What is the CVSS score of CVE-2026-41247?
CVE-2026-41247 has a CVSS v3.1 base score of 9.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-41247?
CVE-2026-41247 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.).
How can I check Packagist dependencies for CVE-2026-41247?
Run the dependency tree command: 'inspect dependencies for studio-42/elfinder'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-8q4h-8crm-5cvc",
  "modified" : "2026-05-06T02:35:09Z",
  "published" : "2026-04-17T22:33:51Z",
  "aliases" : [ "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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:P"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "studio-42/elfinder"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.1.67"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "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"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-78" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-17T22:33:51Z",
    "nvd_published_at" : "2026-04-23T19:17:29Z"
  }
}