CVE-2026-115894pimcore/pimcore Protection Mechanism Failure
NVD
Vulnerability Summary
Incomplete fix of the Twig sandbox hardening (#19193 / GHSA-5qxq sibling): model getters reachable → admin password-hash / recovery-token exfiltration & arbitrary asset read - ID: PIM-001 - Target: pimcore/pimcore `v12` / `v2026.1.x` (HEAD `2026.x`, commit `caf12dc231`; the relevant guard `fffa7f6396` #19193, 2026-06-17) - Severity: HIGH (cross-trust-boundary information disclosure → admin account takeover). Note: maintainers rated the RCE sibling GHSA-5qxq Medium; final rating is theirs. - CVSS v3.1: `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N` — Base 7.7 (High). - CWE: CWE-693 (Protection Mechanism Failure / blocklist sandbox) + CWE-1336 (SSTI) → CWE-522/CWE-200 (credential & data exposure), enabling CWE-639 (account takeover). - Status: CONFIRMED (executable PoC against the verbatim `SecurityPolicy.php`). Distinct from — and an incomplete fix of — the #19193 sandbox hardening (which itself hardened GHSA-5qxq-vgmm-q39m). --- Summary Pimcore renders user-authored Twig (email document subjects/bodies, DataObject `ClassDefinition\Layout\Text`) inside a sandbox whose policy is `lib/Twig/Sandbox/SecurityPolicy.php`. The original SSTI/RCE in this surface was GHSA-5qxq-vgmm-q39m (Mail & Dynamic Text). Commit #19193 (`fffa7f6396`, 2026-06-17 — the current HEAD mitigation) added a method/property check to stop sandbox escape into infrastructure objects, via a blocklist of 6 classes: ```php // SecurityPolicy.php:39-46 private const BLOCKED_CLASSES = [ \Pimcore\Model\Dao\AbstractDao::class, \Doctrine\DBAL\Connection::class, PDO::class, PDOStatement::class, \Symfony\Component\DependencyInjection\ContainerInterface::class, \Symfony\Component\Process\Process::class, ]; ``` `checkMethodAllowed`/`checkPropertyAllowed` throw only when the object is an instance of one of those 6 classes (`:107-147`). Every other object's methods are callable. Combined with `checkSecurity` auto-allowing any function named `pimcore_*` (`:97`), a sandboxed template can fetch core model objects and call their getters: ```twig {{ pimcore_user(1).getPassword() }} {# superadmin bcrypt hash #} {{ pimcore_user(1).getPasswordRecoveryToken() }} {# live reset token → admin ATO #} {{ pimcore_asset(ID).getData() }} {# arbitrary asset file content #} ``` The blocklist stops the RCE/DB path (`…getDao().db.query(…)`) that #19193 targeted, but leaves `Pimcore\Model\User` and `Pimcore\Model\Asset` — whose getters expose other users' credentials and arbitrary asset bytes — fully reachable. The fix is incomplete. --- Affected component - Guard (incomplete blocklist): `lib/Twig/Sandbox/SecurityPolicy.php:39-46` (`BLOCKED_CLASSES`), `:97` (`pimcore_*` auto-allow), `:107-147` (instanceof-only checks). - Sandbox render sink: `lib/Mail.php:603` `getTwigEnvironment(true)` → `:612` `$twig->createTemplate($string, …)->render($this->getParams())`, reached from `getSubjectRendered()` (`:636`) and `getBodyHtmlRendered()` (`:657`); also `models/DataObject/ClassDefinition/Layout/Text.php` (Text layout). - Auto-allowed functions: `lib/Twig/Extension/PimcoreObjectExtension.php:43` (`pimcore_asset` → `Asset::getById`), `:48` (`pimcore_user` → `User::getById`). - Secret getters (not blocked): `models/User.php:96` `getPassword()`, `:116` `getPasswordRecoveryToken()`; `models/Asset.php` `getData()`/`getStream()`/`getLocalFile()`. - Default policy: `bundles/CoreBundle/config/pimcore/default.yaml` — `tags: ['set']`, `filters: ['escape','trans','default']` (functions list irrelevant: `pimcore_*` is auto-allowed by prefix). --- Reachability — hop by hop 1. Actor / entry. A backend user with Documents workspace permission (create/edit documents — a non-admin role) creates or edits a Document of type email and places the payload in its subject or HTML body. (The Text-layout variant is class-definition authored = admin; the email/Documents path is the lower-privilege one.) 2. Trigger. The email is sent — via the newsletter feature, a workflow notification (`lib/Workflow/Notification/NotificationEmailService.php`), or a "send test" action. `Mail::send()` → `getSubjectRendered()`/`getBodyHtmlRendered()` → `renderParams()`. 3. Sandbox render. `renderParams` obtains the sandboxed Twig env (`getTwigEnvironment(true)`, `Mail.php:603`) and compiles the attacker string with `createTemplate(...)->render(...)`. 4. Guard. `SecurityPolicy::checkSecurity` allows `pimcore_user`/`pimcore_asset` (`pimcore_*` prefix). `checkMethodAllowed` is invoked for `.getPassword()` on the returned `User` object — `User` is not instanceof any `BLOCKED_CLASS`, so it does not throw. Method executes. 5. Sink. `User::getPassword()` returns the bcrypt hash; `getPasswordRecoveryToken()` the live reset token; `Asset::getData()` the raw file bytes. The value is rendered into the email delivered to the attacker-chosen recipient → observed. Guard analysis (each guard explicitly resolved) - `checkSecurity` (functions) → `pimcore_user`/`pimcore_asset` auto-allowed by the `pimcore_*` prefix rule. Not a blocker. - `checkMethodAllowed` blocklist (#19193) → only blocks 6 infra classes; `User`/`Asset` are not among them, so their getters pass. Verified: the infra path (`getDao().query()`) IS blocked, the model getters are NOT. Not a blocker for this vector. - Twig autoescape → hash/token are plain text; rendered intact under `autoescape=html` and off. Not a blocker. - No allowlist → the policy is a blocklist; any non-infra object is fully traversable. --- Impact A Documents-permission user — not entitled to other users' credentials or to assets outside their ACL — exfiltrates: - the superadmin password hash (offline-crackable), - a live password-recovery token (`getPasswordRecoveryToken()`) → direct account takeover of the superadmin via password reset, - arbitrary asset file content (`pimcore_asset(id).getData()`), bypassing asset workspace ACLs. This crosses the trust boundary the sandbox exists to enforce (and that #19193 explicitly hardened): a lower-privilege template author reaching higher-privilege secrets/data. --- Proof of Concept (safe, benign sentinel) `PIM-001-poc.php` loads the verbatim `lib/Twig/Sandbox/SecurityPolicy.php` from the repo into a real Twig 3 sandbox (configured with the default `default.yaml` policy), with `pimcore_user`/`pimcore_asset` registered exactly as `PimcoreObjectExtension` does, and `User`/`Asset`/`Dao` stubs whose getters return benign sentinels. No third-party system, no destructive payload. ``` $ ./php PIM-001-poc.php BLOCKED path (#19193 should block infra method) : BLOCKED by sandbox (Twig\Sandbox\SecurityNotAllowedMethodError) LEAK admin password hash : RENDERED -> $2y$10$SENTINEL-SUPERADMIN-HASH-marker LEAK admin recovery token (ATO) : RENDERED -> SENTINEL-RECOVERY-TOKEN-marker LEAK arbitrary asset file data : RENDERED -> SENTINEL-ASSET-FILE-CONTENT-marker [+] CONFIRMED: #19193 blocklist incomplete — User secrets + asset data exfiltrated via sandbox; infra/DB path blocked ``` The infra/DB path (`getDao().query()`) is correctly blocked by #19193 — proving the policy is active and the test faithful — while the three model-getter leaks render the sentinels. Setup (static PHP + Twig, userspace) is in the PoC header. End-to-end on a live instance: as a Documents user, create an email document with body `{{ pimcore_user(1).getPasswordRecoveryToken() }}`, send it to your own address, read the token, reset the superadmin password. --- Adversarial re-read (what I tried to use to kill it) - "#19193 blocks this." The PoC uses the real policy: the infra method path is blocked, but `User`/`Asset` getters are not (they're not in `BLOCKED_CLASSES`). The fix is class-instance-scoped to infra only. → not killed. - "`pimcore_user` isn't allowed in the sandbox." `checkSecurity` auto-allows any `pimcore_*` function (`:97`), independent of the configured functions list. → not killed. - "Autoescape neutralises the leak." Verified leak under both `autoescape=html` and off (sentinels have no HTML-significant chars). → not killed. - "This is the already-fixed GHSA-5qxq / a re-report of #19193." GHSA-5qxq was the RCE via the unsandboxed-method chain, patched by introducing the sandbox; #19193 added the method blocklist to stop the surviving infra-escape. This finding is the part #19193 did not cover — model-getter info disclosure. Distinct, surviving vector. → not a duplicate. - "It's just admin authoring Twig (the role)." The sandbox exists precisely to contain template authors; #19193 codifies that they must not reach sensitive objects. The Documents-permission author is a non-admin, and the data read (other users' credentials, out-of-ACL assets) is outside that role. → it is a boundary crossing, not the role. Honest residual / CONDITIONAL note: the end-to-end HTTP chain (author email as a Documents-only user → trigger send → observe output) is reasoned from Pimcore's documented permission model; the send-trigger UI lives in the separate `admin-ui-classic-bundle` (not in this repo), so it was not executed here. The sandbox-control failure itself is executed and confirmed. If a deployment restricts email-document authoring to admins, the impact degrades to admin-scope and severity drops. --- Remediation 1. Convert the sandbox method/property check to an allowlist (Twig `allowedMethods`/`allowedProperties`) rather than a 6-class blocklist. 2. At minimum, add `Pimcore\Model\User` (and `User\`) and the content-returning `Asset` methods (`getData`, `getStream`, `getLocalFile`, `getTemporaryFile`) to the block set; `getPassword()`/`getPasswordRecoveryToken()` must never be template-reachable. 3. Replace the unconditional `pimcore_` function auto-allow with an explicit enumeration of safe functions. --- Confidence High on the security-control failure (verbatim policy + real Twig PoC; infra path blocked, model getters not). Medium on the end-to-end lower-privilege reachability, which depends on the admin-ui send/authoring path not covered in this repo — stated explicitly as a CONDITIONAL.
CVSS v3.1 Base Metrics — Score 7.7
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:NAttack VectorNetwork
Attack ComplexityLow
Privileges RequiredLow
User InteractionNone
ScopeChanged
ConfidentialityHigh
IntegrityNone
AvailabilityNone
Affected & Patched Versions
- pimcore/pimcore >= 2026.1.0, <= 2026.2.4
- pimcore/pimcore >= 12.3.0, <=12.3.11
- pimcore/pimcore 2026.2.5
- pimcore/pimcore 12.3.12
What to do
Prioritize this fix. Exploit code is public, so attacks can follow quickly.
- Check whether you run pimcore/pimcore and which version.
- Update to a patched version listed above, then confirm the new version.
- Review logs and exposed services for signs of earlier compromise.
Timeline
- Oct 26, 2026Published
- Oct 26, 2026Record last modified
Score, severity and exploitation changes are tracked from the day Watchtower started logging them.
Get notified about new pimcore/pimcore CVEsYou are reading CVE-2026-115894. Get an email when KEV listings, exploits or new CVEs match your stack.
Set up CVE alertsExternal References
Data last checked: Nov 24, 2026 14:01 UTC