GHSA-8Q4H-8CRM-5CVC
Vulnerability from github – Published: 2026-04-17 22:33 – Updated: 2026-04-17 22:33Severity
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 Patched:
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 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
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 for the responsible disclosure.
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "studio-42/elfinder"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2.1.67"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-78"
],
"github_reviewed": true,
"github_reviewed_at": "2026-04-17T22:33:51Z",
"nvd_published_at": null,
"severity": "HIGH"
},
"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 \u003cFIXED_VERSION\u003e\nPatched: \u003cFIXED_VERSION\u003e\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 for the responsible disclosure.",
"id": "GHSA-8q4h-8crm-5cvc",
"modified": "2026-04-17T22:33:51Z",
"published": "2026-04-17T22:33:51Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/Studio-42/elFinder/security/advisories/GHSA-8q4h-8crm-5cvc"
},
{
"type": "PACKAGE",
"url": "https://github.com/Studio-42/elFinder"
}
],
"schema_version": "1.4.0",
"severity": [
{
"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",
"type": "CVSS_V4"
}
],
"summary": "elFinder: Command injection in resize background color parameter when using ImageMagick CLI"
}
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.