Skip to main content
Vulnerability Database/CVE-2026-104069

CVE-2026-104069: HortusFox Theme Upload RCE Vulnerability

CVE-2026-104069 is a remote code execution flaw in HortusFox before version 6.2 affecting the theme upload functionality. Authenticated administrators can exploit this to execute arbitrary commands. This post covers technical details, affected versions, impact assessment, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-104069 Overview

CVE-2026-104069 is a remote code execution vulnerability in HortusFox versions prior to 6.2. The flaw resides in ThemeModule::startImport(), which extracts uploaded ZIP archives directly into the public web root before validating file names, extensions, or content. An authenticated administrator can upload a crafted theme archive containing a PHP file and an .htaccess file that re-enables script execution. The attacker then requests the planted file under the themes directory to execute arbitrary operating system commands as the web-server user. The weakness is classified as unrestricted upload of file with dangerous type [CWE-434].

Critical Impact

Authenticated administrators can achieve arbitrary command execution as the web-server user, leading to full compromise of the HortusFox host and any data accessible to the web server.

Affected Products

  • HortusFox web application versions before 6.2
  • Deployments exposing the administrator theme import functionality
  • Self-hosted HortusFox instances running on PHP-capable web servers

Discovery Timeline

  • 2026-10-06 - CVE-2026-104069 published to NVD
  • 2026-10-06 - Last updated in NVD database

Technical Details for CVE-2026-104069

Vulnerability Analysis

HortusFox allows administrators to import themes as ZIP archives through the ThemeModule::startImport() function. The pre-patch code calls $zip->extractTo(public_path() . '/themes/' . $import_file) and then $zip->close() without performing any inspection of the archive contents. Because extraction targets a publicly reachable directory, any file written to disk becomes requestable over HTTP. The application does not restrict file extensions, strip executable payloads, or override directory-level execution policies. An administrator-level attacker can therefore place a .php file and an .htaccess file into the webroot in a single operation. The archive extraction order ensures the .htaccess directive is active before the attacker requests the PHP payload, enabling command execution as the account running the web server (typically www-data).

Root Cause

The root cause is missing validation after archive extraction [CWE-434]. ThemeModule::startImport() trusts the archive contents implicitly and relies on no deny-list, allow-list, or MIME inspection. The theme directory also lacks a hardened server configuration preventing .htaccess overrides, which allows an attacker-supplied .htaccess file to re-enable PHP execution within the themes path.

Attack Vector

Exploitation requires authenticated administrator access to the HortusFox panel. The attacker crafts a ZIP archive containing a web shell such as shell.php and an .htaccess file with directives like AddType application/x-httpd-php .php and php_flag engine on. After submitting the archive through the theme import feature, the attacker browses to /themes/<import_name>/shell.php to invoke the payload. The server then executes attacker-supplied commands under the web-server identity.

php
// Vendor fix in app/modules/ThemeModule.php (v6.2)
// Source: https://github.com/danielbrendel/hortusfox-web/commit/3b87393d38ce408ec6f0946ffb3cbf0d08b5f07c
$zip->extractTo(public_path() . '/themes/' . $import_file);
$zip->close();

UtilsModule::safetyClean(public_path() . '/themes/' . $import_file);

$folders = scandir(public_path() . '/themes/' . $import_file);
foreach ($folders as $folder) {
    if (substr($folder, 0, 1) !== '.') {
        // ... continued processing
    }
}

Stop Remote Code Execution Before It Runs

Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.

Stop Exploit Attempts

Detection Methods for CVE-2026-104069

Indicators of Compromise

  • Unexpected .php, .phtml, .phar, or .htaccess files beneath the HortusFox public/themes/ directory.
  • Web server access logs showing GET or POST requests to /themes/<name>/*.php paths shortly after a theme import event.
  • New or modified theme folders not corresponding to legitimate theme packages shipped by vendors or administrators.
  • Outbound network connections from the web-server process to unknown hosts following theme import activity.

Detection Strategies

  • Alert on write events that create executable file extensions inside the public/themes/ tree.
  • Correlate HortusFox application logs for ThemeModule import events with subsequent HTTP requests to files in the same import path.
  • Hunt for .htaccess files containing directives such as AddType, AddHandler, or php_flag engine on within web-accessible directories.

Monitoring Recommendations

  • Enable file integrity monitoring on the HortusFox webroot, especially the themes directory.
  • Monitor process trees for child processes spawned by the PHP interpreter or web server (php-fpm, apache2, nginx) that invoke shells or system utilities.
  • Review administrator session activity for anomalous theme uploads outside normal maintenance windows.

How to Mitigate CVE-2026-104069

Immediate Actions Required

  • Upgrade HortusFox to version 6.2 or later, which introduces UtilsModule::safetyClean() to remove unsafe files after extraction.
  • Audit the public/themes/ directory for unauthorized PHP or .htaccess files and remove any that are not part of a legitimate theme.
  • Rotate administrator credentials and session tokens if theme import activity cannot be fully accounted for.
  • Restrict access to the HortusFox administrator interface to trusted networks or VPN endpoints.

Patch Information

The fix is included in HortusFox Release v6.2 and implemented in this commit. Additional background is available in the VulnCheck Advisory. The patch adds a safetyClean() routine that recursively scans the extracted theme and removes any file matching unsafe-extension checks via UtilsModule::checkUnsafeFileName().

php
// Vendor fix in app/modules/UtilsModule.php (v6.2)
// Source: https://github.com/danielbrendel/hortusfox-web/commit/3b87393d38ce408ec6f0946ffb3cbf0d08b5f07c
public static function safetyClean($destination)
{
    try {
        $assets = scandir($destination);
        foreach ($assets as $asset) {
            if ((strlen($asset) <= 2) && (substr($asset, 0, 1) === '.')) {
                continue;
            }

            if (!is_dir($destination . '/' . $asset)) {
                if (UtilsModule::checkUnsafeFileName($asset)) {
                    if (!unlink($destination . '/' . $asset)) {
                        throw new \Exception('Security alert: unsafe asset could not be removed: ' . $destination . '/' . $asset);
                    }
                }
            } else {
                static::safetyClean($destination . '/' . $asset);
            }
        }
    } catch (\Exception $e) {
        throw $e;
    }
}

Workarounds

  • Disable the theme import feature or remove administrator permissions to use it until the upgrade is applied.
  • Configure the web server to disallow .htaccess overrides for the themes directory by setting AllowOverride None in the relevant Apache context.
  • Deny execution of PHP files beneath the public/themes/ directory using server-level rules in Nginx or Apache.
bash
# Apache: block PHP execution and overrides in the themes directory
<Directory "/var/www/hortusfox/public/themes">
    AllowOverride None
    php_admin_flag engine off
    <FilesMatch "\.(php|phtml|phar)$">
        Require all denied
    </FilesMatch>
</Directory>

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.