
PoC and differential lab for CVE-2026-104881, a Contao newsletter-bundle authorization bypass letting non-admins run send/importRecipients on out-of-scope channels.
| CVE | CVE-2026-104881 |
| Component | contao/newsletter-bundle — Newsletter::send / importRecipients (contao/classes/Newsletter.php) |
| Affected | < 5.3.50 |
| Fixed in | 5.3.50 — commit 1471dcaf (GHSA-3r9g-pfhv-3228) |
| CWE | CWE-863 (Incorrect Authorization) |
| Impact | Channel access is enforced only by DataContainer voters that fire for DC_Table CRUD actions; the newsletter send / importRecipients key-actions are dispatched after only the module-level check, so a non-admin with module access can send newsletters / import recipients for channels outside their scope |
| Vector | Authenticated non-admin backend user invoking a newsletter key-action |
| Trigger | send key-action targeting an out-of-scope newsletter channel |
The vulnerable key-action ran with no per-record vote:
// Newsletter::send — pre-fix (dispatched by Backend::getBackendModule)
public function send(DataContainer $dc) {
$db = Database::getInstance(); // no channel access check
...
}
The fix enforces the per-record voter at the start of the key-action:
// fixed (commit 1471dcaf)
public function send(DataContainer $dc) {
$this->denyAccessUnlessGranted(
ContaoCorePermissions::DC_PREFIX . $dc->table,
new ReadAction($dc->table, $dc->getCurrentRecord())
);
...
}
private function denyAccessUnlessGranted(mixed $attribute, mixed $subject = null): void {
if (!System::getContainer()->get('security.helper')->isGranted($attribute, $subject)) {
throw new AccessDeniedException(...);
}
}
Channel access is enforced by NewsletterChannelAccessVoter /
NewsletterRecipientsAccessVoter (requiring USER_CAN_EDIT_CHANNEL). Their
supportsType() fires exclusively for Create/Read/Update/DeleteAction
subjects dispatched inside DC_Table's create/edit/delete methods. The
newsletter custom key-actions (send, importRecipients) are dispatched
directly by Backend::getBackendModule() after only the module-level
USER_CAN_ACCESS_MODULE check; the DC_Table constructor runs no per-record
ReadAction vote for a key-action, and Newsletter.php contained no
isGranted check. A non-admin with newsletter module access could therefore
send a newsletter or import recipients for a channel outside their assigned
scope. The fix adds denyAccessUnlessGranted(DC_PREFIX.table, ReadAction(...))
at the start of send() and a CreateAction check in importRecipients()
(plus a per-record CreateAction check in the import loop), so the channel
voter is enforced on the key-action path.
| service | image | role |
|---|---|---|
nl-vuln | cve-2026-104881:vuln | real Newsletter::send (pre-fix) |
nl-fixed | cve-2026-104881:fixed | real send + helper (vendor fix 1471dcaf) |
poc | cve-2026-104881-poc:local | stdlib-only Python driver |
A PHP harness loads the real send() method verbatim from each tag (plus the
denyAccessUnlessGranted helper for the fixed build). Because PHP resolves
classes at runtime, only the executed path needs stubs: the fixed send()
throws at denyAccessUnlessGranted (first line); the vulnerable send() hits
a Database mock returning numRows=0 and returns early. The
security.helper is mocked to deny an out-of-scope channel. Both sides differ
only in the upstream method source.
./run-lab.sh build # builds both sides (php:8.3-cli)
./run-lab.sh up # cve104881lab network: nl-vuln / nl-fixed
./run-lab.sh sweep
./run-lab.sh down
poc/poc.py (stdlib only):
send() proceeds, 0 when denied;
3 no worker, 2 unreachable/indeterminate.1471dcaf.A standalone full-chain exploit ships at exploit/exploit.py:
python3 exploit/exploit.py --host=nl-vuln
# exit 1 on confirmed access bypass, 0 on a safe target
| scope | nl-vuln (pre-fix) | nl-fixed (1471dcaf) |
|---|---|---|
| out-of-scope | proceeded (bypass) | denied (Not enough permissions to access ReadAction(tl_newsletter)) |
| in-scope (control) | proceeded (legit) | proceeded (legit) |
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.
cve104881lab
network; PHP 8.3 runtime in the lab images.USER_CAN_ACCESS_MODULE) but no rights to the target channel.The fixed send() / importRecipients() enforce the per-record
ReadAction / CreateAction vote via denyAccessUnlessGranted at the start of
the key-action, so out-of-scope channels are denied while in-scope access still
proceeds. The recipients-import loop also checks CreateAction per new record.
No key-action access-bypass 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 method source
lab/vendor/ verbatim send() (+ helper) from pre-fix / fix commits
lab/stubs.php minimal executed-path stubs (Database, System, voter, ...)
lab/gen.py assembles the Newsletter class from the verbatim method
lab/harness.php drives the real send() as a non-admin
lab/service.py HTTP wrapper (POST /send)
evidence/ captured runs of every mode on both sides
TRACKING.md excluded (working record)