CVE-2026-11407
Executive Summary
CVE-2026-11407 is a critical sandbox bypass vulnerability in Pimcore CMS/DXP version 12.3.8. An authenticated administrative attacker can exploit empty checkMethodAllowed() and checkPropertyAllowed() implementations in the custom Twig SecurityPolicy to execute arbitrary methods on PHP objects. By supplying malicious Twig templates through the DataObject ClassDefinition Layout/Text component, the attacker can perform arbitrary file reads, execute arbitrary database queries, and potentially achieve remote code execution via PHP object gadget chains. The pimcore_* function wildcard further broadens the bypass to all Pimcore Twig functions. This vulnerability has a CVSS score of 7.2 (High) and is publicly known with no official patch available.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability is not directly related to a package manager (NPM, PyPI, Go, Ruby) but affects the Pimcore CMS/DXP application, which is a PHP-based open-source platform. The risk is in the supply chain of Twig templates and custom security policies. Organizations using Pimcore should audit their Twig template usage and restrict administrative access.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
- Base Score: 7.2 (High)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: High (PR:H) – requires admin authentication
- User Interaction: None (UI:N)
- Scope: Unchanged (S:U)
- Confidentiality Impact: High (C:H)
- Integrity Impact: High (I:H)
- Availability Impact: High (A:H)
Threat Level: High. Although authentication is required, an admin-level attacker can fully compromise the server.
Deep Dive & Mechanics
The vulnerability lies in the custom Twig SecurityPolicy implementation in Pimcore 12.3.8. The checkMethodAllowed() and checkPropertyAllowed() methods are empty, meaning they do not enforce any restrictions on which methods or properties can be called on PHP objects within Twig templates. Additionally, the pimcore_* function wildcard allows all Pimcore Twig functions to be used without restriction.
An attacker with admin access can create or modify a DataObject ClassDefinition and inject a malicious Twig template into the Layout/Text component. This template can call arbitrary PHP object methods, such as file_get_contents() for file reads, PDO::query() for database queries, or chain PHP object gadgets for RCE.
Key Components:
- Twig SecurityPolicy: The custom policy fails to restrict method/property calls.
- DataObject ClassDefinition: Allows embedding Twig templates in layout text fields.
- PHP Object Gadget Chains: Can be used to achieve RCE if the server has vulnerable libraries.
Vulnerable vs. Patched Code
Vulnerable Code (Pimcore 12.3.8):
// In custom Twig SecurityPolicy
class PimcoreSecurityPolicy implements SecurityPolicyInterface {
public function checkMethodAllowed($obj, $method) {
// Empty - no restrictions
}
public function checkPropertyAllowed($obj, $property) {
// Empty - no restrictions
}
}
Patched Code (Hypothetical fix):
class PimcoreSecurityPolicy implements SecurityPolicyInterface {
private $allowedMethods = ['method1', 'method2'];
private $allowedProperties = ['prop1', 'prop2'];
public function checkMethodAllowed($obj, $method) {
if (!in_array($method, $this->allowedMethods)) {
throw new SecurityNotAllowedMethodError($method);
}
}
public function checkPropertyAllowed($obj, $property) {
if (!in_array($property, $this->allowedProperties)) {
throw new SecurityNotAllowedPropertyError($property);
}
}
}
Exploitation & Lab Setup
Red Team
Prerequisites:
- Admin access to Pimcore (e.g., user with
adminrole). - Ability to create or edit DataObject ClassDefinitions.
Exploit Steps:
- Log in to Pimcore admin panel.
- Navigate to Settings → Object → Class Definitions.
- Select or create a class, then edit the Layout/Text component.
- Inject a malicious Twig template, e.g.:
Or for database query:{{ pimcore_function('file_get_contents', '/etc/passwd') }}{{ pimcore_function('PDO::query', 'SELECT * FROM users') }} - Save the class definition and trigger the template rendering (e.g., by viewing an object of that class).
- The output will contain the file contents or query results.
Advanced RCE via Gadget Chains: If the server has libraries like Monolog or SwiftMailer, use PHP object gadget chains:
{{ pimcore_function('unserialize', '<serialized_gadget_chain>') }}
Blue Team
Detection:
- Monitor for unusual Twig template modifications in DataObject ClassDefinitions.
- Look for
pimcore_functioncalls with suspicious arguments (e.g.,file_get_contents,unserialize). - Check logs for
SecurityNotAllowedMethodErrororSecurityNotAllowedPropertyError(if patched).
Prevention:
- Restrict admin access to trusted users only.
- Implement a custom Twig SecurityPolicy with strict allowlists.
- Disable the
pimcore_*wildcard if not needed. - Use Web Application Firewall (WAF) rules to block malicious Twig templates.
Indicators of Compromise (IOCs)
- File System: Unexpected file reads (e.g.,
/etc/passwd,/etc/shadow). - Database: Unusual SQL queries in logs (e.g.,
SELECT * FROM users). - Network: Outbound connections from the Pimcore server to unknown IPs (if RCE achieved).
- Logs: Pimcore application logs showing
pimcore_functioncalls with suspicious arguments. - Twig Templates: Modified DataObject ClassDefinitions containing
pimcore_functionor direct method calls.
Detection Engineering
YARA Rule
rule CVE_2026_11407_Twig_Sandbox_Bypass {
meta:
description = "Detects malicious Twig templates exploiting CVE-2026-11407"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2026-11407"
strings:
$twig_func = /pimcore_function\s*\(/
$file_read = /file_get_contents/
$db_query = /PDO::query/
$unserialize = /unserialize/
condition:
any of ($twig_func) and any of ($file_read, $db_query, $unserialize)
}
Sigma Rule
title: CVE-2026-11407 Twig Sandbox Bypass
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects exploitation of CVE-2026-11407 via malicious Twig templates
author: Valters IT
date: 2025-04-10
logsource:
category: application
product: pimcore
detection:
selection:
EventID: 1000 # Example Pimcore event ID for template rendering
Message|contains:
- 'pimcore_function'
- 'file_get_contents'
- 'PDO::query'
- 'unserialize'
condition: selection
falsepositives:
- Legitimate use of pimcore_function in custom templates
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2026-11407 Twig Sandbox Bypass"; flow:to_server,established; content:"pimcore_function"; http_uri; nocase; content:"file_get_contents"; http_uri; nocase; classtype:attempted-admin; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate: Restrict admin access to only trusted users. Disable the
pimcore_*wildcard in the Twig SecurityPolicy configuration. - Short-term: Implement a custom Twig SecurityPolicy with strict allowlists for methods and properties. Monitor for suspicious Twig template modifications.
- Long-term: Apply vendor patches when available. Consider upgrading to a patched version of Pimcore.
- Compensating Controls: Use WAF rules to block malicious Twig templates. Enable logging and alerting for unusual
pimcore_functioncalls.
Valters IT – DevSecOps & Cyber Threat Intelligence