
Proof-of-concept and lab for CVE-2026-104883: a delegated Contao user manager self-grants theme_import to escalate to PHP RCE, with differential vuln/fixed harness.
| CVE | CVE-2026-104883 |
| Component | contao/core-bundle — CheckTemplateEditorSaveListener / TemplateEditorModuleVoter (tl_user, tl_user_group) |
| Affected | < 5.3.50 (and the 5.7.x line before the fix) |
| Fixed in | 5.3.50 — commit 211498f28 (GHSA-r9qp-pqx5-8369) |
| CWE | CWE-269 (Improper Privilege Management), CWE-863 (Incorrect Authorization) |
| Impact | A delegated user/group manager (a role explicitly not trusted with template/code access) can self-grant the RCE-capable theme_import capability — and layout, unfiltered_html, etc. — escalating to arbitrary PHP execution on the server |
| Vector | Authenticated low-privilege backend user editing their own account/group |
| Trigger | save themes = ['theme_import'] (the themes field had no guard) |
The 5.7.3 hardening guarded only modules / tpl_editor:
// vulnerable CheckTemplateEditorSaveListener — registered only on fields.modules.save
if (!\is_array($newModules) || !\in_array('tpl_editor', $newModules, true)) {
return $value; // themes/theme_import is never inspected -> grant accepted
}
The fix guards every implicit-admin field and value:
// fixed CheckImplicitAdminSaveListener (commit 211498f28)
private const IMPLICIT_ADMIN_VALUES = [
'modules' => ['tpl_editor'],
'themes' => ['theme_import', 'layout'],
'elements' => ['unfiltered_html'],
'frontendModules' => ['unfiltered_html', 'listing'],
'alexf' => [/* list_table, list_where, unfilteredHtml, ... */],
];
// registered on fields.modules/themes/elements/frontendModules/alexf.save;
// throws AccessDeniedException (ERR.grantAdminOnly) for a non-admin self-grant.
Commit 2b83a60f7763 (5.7.3) hardened the template editor by adding
TemplateEditorModuleVoter and a save callback so a non-admin cannot self-grant
the tpl_editor backend module (editable PHP-capable templates allow
server-side code execution). That protection covers only the modules field
and the literal value tpl_editor. The equally RCE-capable theme_import
capability lives in a different field — the themes checkbox field
(tl_user_group.php / tl_user.php) — which had no save_callback and no
voter. TemplateEditorModuleVoter is the only DataContainer voter registered
for tl_user_group and does not cover themes. A delegated user manager can
therefore add themes to the modules field and theme_import to the themes
field (both accepted — only tpl_editor is blocked), re-authenticate, and gain
arbitrary PHP execution. The fix renames the listener to
CheckImplicitAdminSaveListener, registers it on
modules/themes/elements/frontendModules/alexf, and denies non-admin
self-grants of every implicit-admin value.
| service | image | role |
|---|---|---|
ct-vuln | cve-2026-104883:vuln | real CheckTemplateEditorSaveListener (pre-fix) |
ct-fixed | cve-2026-104883:fixed | real CheckImplicitAdminSaveListener (vendor fix) |
poc | cve-2026-104883-poc:local | stdlib-only Python driver |
A PHP harness loads the real upstream listener class verbatim from each tag and
invokes __invoke($value, $dc) as a non-admin (isGranted('ROLE_ADMIN') = false) on a given field/value with no prior access. The Symfony/Contao
dependencies are stubbed; the listener logic itself is untouched. Both sides
differ only in the upstream listener source.
./run-lab.sh build # builds both sides (php:8.3-cli)
./run-lab.sh up # cve104883lab network: ct-vuln / ct-fixed
./run-lab.sh sweep
./run-lab.sh down
poc/poc.py (stdlib only):
themes=['theme_import'] save is
accepted, 0 when denied; 3 no worker, 2 unreachable/indeterminate.theme_import → re-auth → arbitrary PHP execution.tpl_editor (guarded on both), theme_import
/ layout / unfiltered_html (the bypass), benign module control.211498f28.A standalone full-chain exploit ships at exploit/exploit.py:
python3 exploit/exploit.py --host=ct-vuln
# exit 1 on confirmed implicit-admin self-grant, 0 on a safe target
| non-admin save | ct-vuln (pre-fix) | ct-fixed (211498f28) |
|---|---|---|
modules = ['tpl_editor'] | denied (ERR.grantTemplateEditor) | denied (ERR.grantAdminOnly) |
themes = ['theme_import'] | granted (bypass) | denied |
themes = ['layout'] | granted | denied |
elements = ['unfiltered_html'] | granted | denied |
modules = ['news'] (benign) | granted | granted |
Captured runs: evidence/check-*-run.txt, evidence/exploit-*-run.txt,
evidence/probe-*-run.txt, evidence/mitigation-*-run.txt,
evidence/exploit-standalone-run.txt, evidence/exploit-standalone-fixed-run.txt,
evidence/versions.txt, evidence/0day-sweep.txt.
cve104883lab
network; PHP 8.3 runtime in the lab images.user or group backend module) on a Contao installation; no admin
access is needed.The fixed CheckImplicitAdminSaveListener denies every implicit-admin
self-grant across modules/themes/elements/frontendModules/alexf
(tpl_editor, theme_import, layout, unfiltered_html, listing, the
alexf list fields) for non-admins without prior access. Benign values still
save. The earlier tpl_editor-only guard left theme_import / layout /
unfiltered_html open; the fix closes all of them. No implicit-admin
self-grant path remains.
README.md this write-up
run-lab.sh environment driver (build / up / sweep / down)
Makefile convenience targets
poc/poc.py the PoC (check / exploit / probe / mitigation)
exploit/exploit.py standalone full-chain exploit
lab/lab.Dockerfile builds both sides from upstream listener source
lab/vendor/ verbatim listener class from pre-fix / fix commits
lab/stubs.php minimal Symfony/Contao dependency stubs
lab/harness.php invokes the real listener as a non-admin
lab/service.py HTTP wrapper (POST /check)
evidence/ captured runs of every mode on both sides
TRACKING.md excluded (working record)
2b83a60f7763 (5.7.3, tpl_editor-only)