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-107248 Overview
CVE-2026-107248 is a server-side template injection (SSTI) vulnerability in Thelia 3.0.0's back-office Email/Messages feature. The flaw lets any authenticated user with the Messages permission supply unsandboxed Twig templates. Thelia compiles and executes those templates as raw PHP code. An attacker can call arbitrary PHP functions, read sensitive files, and write to the filesystem. Successful exploitation leads to full compromise of the application and the underlying host. The issue is tracked under CWE-94: Improper Control of Generation of Code and has been patched in thelia/twig-engine-module version 1.0.9.
Critical Impact
Authenticated attackers with the Messages permission can achieve remote code execution and host-level compromise through Twig template injection.
Affected Products
- Thelia 3.0.0 back-office Email/Messages module
- thelia/twig-engine-module versions prior to 1.0.9
- Deployments granting the Messages permission to non-administrative back-office accounts
Discovery Timeline
- 2026-10-12 - CVE-2026-107248 published to NVD
- 2026-10-15 - Last updated in NVD database
Technical Details for CVE-2026-107248
Vulnerability Analysis
Thelia's back-office Email/Messages feature stores message bodies that are later rendered by the Twig templating engine. The rendering path uses an unsandboxed Twig environment, so template syntax submitted by an operator is treated as executable code rather than inert content. An authenticated user with the Messages permission can modify a Message, embed Twig expressions, and trigger compilation on the next render. The compiled template runs within the PHP process serving Thelia, giving attackers the same privileges as the web application. This is a classic [CWE-94] code injection pattern applied to a templating engine.
Root Cause
The thelia/twig-engine-module component instantiated a Twig environment without the sandbox extension or an allowlist of safe tags, filters, and functions. Operator-supplied template content was passed directly to the compiler. Twig constructs such as {{ ... }} and {% ... %} therefore resolved to PHP calls at render time. Thelia also failed to treat the Messages permission as a code-execution capability, allowing low-privileged back-office users to reach the vulnerable sink.
Attack Vector
An attacker first authenticates to the Thelia back-office with an account that holds the Messages permission. The attacker edits an existing Message or creates a new one and injects Twig syntax into the body. When Thelia renders the Message, for example when sending a transactional email, the engine compiles the attacker's template and executes the embedded expressions. From there the attacker can invoke PHP functions to run shell commands, exfiltrate configuration files containing database credentials, or drop a web shell into the webroot. Technical details are described in the CERT Vulnerability Advisory #162329.
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 AttemptsDetection Methods for CVE-2026-107248
Indicators of Compromise
- Message records in the Thelia database containing Twig control structures such as {{, {%, _self, getFilter, or references to system, exec, passthru, or file_get_contents.
- Unexpected PHP processes spawned by the web server user shortly after a Message is saved or sent.
- New or modified files inside the Thelia webroot, cache, or var/ directory that do not correspond to a scheduled deployment.
- Outbound network connections from the Thelia host to attacker-controlled infrastructure immediately following back-office Message activity.
Detection Strategies
- Audit the Messages table for template syntax or PHP function names that should never appear in operator-authored email content.
- Enable PHP disable_functions logging and alert on invocations of system, exec, shell_exec, proc_open, or passthru from the Thelia process.
- Correlate back-office authentication events for accounts holding the Messages permission with subsequent file write or process creation events on the host.
Monitoring Recommendations
- Forward Thelia application logs, web server access logs, and host process telemetry to a centralized analytics platform for correlation.
- Alert on edits to Message templates performed by non-administrative accounts, particularly outside normal business hours.
- Monitor filesystem integrity for the Thelia webroot and configuration directories to catch dropped web shells or modified configuration files.
How to Mitigate CVE-2026-107248
Immediate Actions Required
- Upgrade thelia/twig-engine-module to version 1.0.9 or later using Composer.
- Review every back-office account that currently holds the Messages permission and revoke it from users who do not require it.
- Inspect existing Message records for Twig syntax or suspicious PHP function names and remove any attacker-planted templates.
- Rotate database credentials, API keys, and secrets stored in Thelia configuration if compromise is suspected.
Patch Information
The maintainers released a fix in thelia/twig-engine-module1.0.9. The patched release restricts the Twig environment used for Message rendering so operator-supplied content is no longer compiled as arbitrary code. Operators running Thelia 3.0.0 should update the module through Composer and clear the Thelia cache after deployment. See the CERT Vulnerability Advisory #162329 for additional vendor references.
Workarounds
- Restrict back-office access to the Email/Messages feature to trusted administrators until the patch is applied.
- Place the Thelia back-office behind an authenticated reverse proxy or IP allowlist to reduce exposure to credential compromise.
- Deploy a web application firewall rule that blocks Twig control sequences such as {{ and {% in POST bodies submitted to Message editing endpoints.
# Configuration example
composer require thelia/twig-engine-module:^1.0.9
php Thelia cache:clear --env=prod
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

