VYPR
Unrated severityNVD Advisory· Published Jun 17, 2026

Pimcore CMS 12.3.8 Twig Sandbox Bypass via SecurityPolicy checkMethodAllowed

CVE-2026-11407

Description

Pimcore CMS/DXP version 12.3.8 contains a sandbox bypass vulnerability that allows authenticated administrative attackers to execute arbitrary methods on PHP objects by exploiting empty checkMethodAllowed() and checkPropertyAllowed() implementations in the custom Twig SecurityPolicy. Attackers can supply malicious Twig templates through the DataObject ClassDefinition Layout\Text component to perform arbitrary file reads, execute arbitrary database queries, and potentially achieve remote code execution via PHP object gadget chains, with the pimcore_* function wildcard further broadening the bypass to all Pimcore Twig functions.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

Affected products

1

Patches

Vulnerability mechanics

Root cause

"Empty checkMethodAllowed() and checkPropertyAllowed() implementations in the custom Twig SecurityPolicy allowed unrestricted method calls and property accesses on PHP objects from Twig templates."

Attack vector

An authenticated administrative attacker can supply a malicious Twig template through the DataObject ClassDefinition Layout\Text component. Because the custom Twig `SecurityPolicy` had empty `checkMethodAllowed()` and `checkPropertyAllowed()` implementations [patch_id=6466818], the sandbox did not block method calls or property reads on any PHP object reachable from the template context. The attacker can chain method calls (e.g. `object.getDao().db.fetchOne(...)`) to read arbitrary files, execute arbitrary database queries, and—by leveraging PHP object gadget chains—achieve remote code execution. The `pimcore_*` function wildcard in `checkSecurity()` further broadens the bypass to all Pimcore Twig functions.

Affected code

The vulnerability resides in `lib/Twig/Sandbox/SecurityPolicy.php` in Pimcore 12.3.8. The `checkMethodAllowed()` and `checkPropertyAllowed()` methods previously contained only a comment `//do not perform any checks`, meaning no sandbox restrictions were enforced on method calls or property accesses on objects in Twig templates. The `checkSecurity()` method also allowed any function starting with `pimcore_` to pass without restriction.

What the fix does

The patch replaces the empty `checkMethodAllowed()` and `checkPropertyAllowed()` bodies with iteration over a `BLOCKED_CLASSES` constant containing sensitive infrastructure classes (`AbstractDao`, `Connection`, `PDO`, `PDOStatement`, `ContainerInterface`, `Process`). If the object being accessed is an instance of any blocked class, a `SecurityNotAllowedMethodError` or `SecurityNotAllowedPropertyError` is thrown, preventing the template from traversing into database or infrastructure layers. The patch also corrects the comment in `checkSecurity()` but does not remove the `pimcore_*` wildcard.

Preconditions

  • authAttacker must be authenticated with administrative privileges to edit DataObject ClassDefinition Layout\Text components.
  • configThe application must have Twig sandbox mode enabled.
  • inputAttacker must be able to supply a malicious Twig template through the DataObject ClassDefinition Layout\Text component.

Generated on Jun 18, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

3

News mentions

0

No linked articles in our index yet.