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

CVE-2026-109397: Thelia CMS RCE Vulnerability

CVE-2026-109397 is a remote code execution vulnerability in Thelia CMS allowing authenticated users to upload malicious PHP files. This post covers technical details, affected versions, security impact, and mitigation steps.

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-109397 Overview

CVE-2026-109397 is an unrestricted file upload vulnerability in Thelia, an open-source PHP e-commerce platform. Thelia versions before 3.1.2 and 3.2.x before 3.2.1 allow authenticated back-office users to upload PHP files by appending a trailing space to the filename. The FileProcessorService validates the raw filename, but FileManager::sanitizeFileName() strips the trailing space during storage. The resulting executable .php file is written to public/cache/documents/, enabling arbitrary code execution as the web server user. The flaw is tracked as [CWE-434: Unrestricted Upload of File with Dangerous Type].

Critical Impact

Authenticated back-office users can achieve remote code execution on the host, compromising the web server process and any data it can access.

Affected Products

  • Thelia versions before 3.1.2
  • Thelia 3.2.x versions before 3.2.1
  • Deployments exposing the back-office interface to untrusted administrators

Discovery Timeline

  • 2026-10-12 - CVE-2026-109397 published to NVD
  • 2026-10-13 - Last updated in NVD database

Technical Details for CVE-2026-109397

Vulnerability Analysis

Thelia processes file uploads through two components that disagree on the final filename. FileProcessorService performs extension and MIME type validation on the raw filename submitted by the client. FileManager::sanitizeFileName() later normalizes that filename before writing it to disk by stripping characters outside [a-zA-Z0-9-_.], including trailing whitespace. An attacker uploads a file named shell.php (note the trailing space). Validation treats the file as having an extension of php which may bypass extension blacklists, while storage writes the file as shell.php. The attacker then requests the stored file through the web server, which executes it as PHP code. Exploitation requires authenticated back-office access, so the attack surface is limited to tenants with administrative accounts or any site where back-office credentials have been compromised.

Root Cause

The root cause is inconsistent filename handling between validation and storage. The validator inspects the client-supplied name while the storage layer silently rewrites it. Any security check that does not operate on the final on-disk name is unreliable. The patched comment makes this explicit, documenting that storage drops every character outside [a-zA-Z0-9-_.].

Attack Vector

The attack is executed over the network against an authenticated back-office session. The adversary submits a document upload containing PHP code with a filename such as payload.php and then requests public/cache/documents/payload.php to trigger execution.

php
     * policy for $objectType (see FileConfiguration). Whatever the policy says, a file
     * name carrying a server-executable segment is always refused.
     *
+    * Storage does not keep the name the client sent: FileManager::renameFile() drops
+    * every character outside [a-zA-Z0-9-_.], so "report.php " is stored as
+    * "report-1.php". The extension checks hold for both names.
+    *
     * @param array<string, list<string>>|null $validMimeTypes
     * @param list<string>|null                $extBlackList

Source: Thelia security patch commit 6b706f5. The patch extends validation so the extension checks hold against the stored filename as well as the submitted one.

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-109397

Indicators of Compromise

  • Files with .php, .phtml, or .phar extensions present under public/cache/documents/ or other Thelia upload directories.
  • Web server access logs showing GET or POST requests to newly created files beneath public/cache/documents/.
  • Back-office audit entries recording document uploads with filenames containing trailing spaces or unusual characters.
  • Outbound network connections from the PHP-FPM or Apache process to unknown hosts shortly after an upload event.

Detection Strategies

  • Hunt for executable file types written to document cache directories that should only contain static assets.
  • Correlate HTTP upload events with subsequent requests to files in the same path within a short time window.
  • Baseline the set of filenames created by Thelia in public/cache/ and alert on deviations such as .php extensions.

Monitoring Recommendations

  • Enable file integrity monitoring on public/cache/documents/ and other writable directories inside the Thelia webroot.
  • Forward web server access logs and PHP error logs to a central analytics platform for continuous review.
  • Review back-office account activity for unexpected logins or privilege use, particularly from new IP addresses.

How to Mitigate CVE-2026-109397

Immediate Actions Required

  • Upgrade Thelia to version 3.1.2 or 3.2.1 or later without delay.
  • Audit public/cache/documents/ for unexpected PHP files and remove any that are not required.
  • Rotate credentials for all back-office accounts and review the user list for unauthorized administrators.
  • Review web server logs for upload activity dating back to the earliest vulnerable deployment.

Patch Information

The fix is included in Thelia 3.1.2 and Thelia 3.2.1. The code changes are published in commits 6b706f5 and b7125890. Full context is available in the GitHub Security Advisory GHSA-5524-qfxp-33v9 and the Vulncheck advisory.

Workarounds

  • Restrict access to the Thelia back-office using network ACLs or VPN until patches are applied.
  • Configure the web server to deny execution of PHP within upload and cache directories.
  • Enforce strict allowlists for document MIME types and extensions at a reverse proxy or WAF layer.
nginx
# Deny PHP execution in Thelia upload and cache directories
location ~* ^/public/cache/.*\.(php|phtml|phar)$ {
    deny all;
    return 403;
}

location ~* ^/public/cache/ {
    default_type application/octet-stream;
}

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.