| CVE | CVE-2026-104881 |
| 组件 | contao/newsletter-bundle — Newsletter::send / importRecipients (contao/classes/Newsletter.php) |
| 受影响版本 | < 5.3.50 |
| 修复版本 | 5.3.50 — commit 1471dcaf (GHSA-3r9g-pfhv-3228) |
| CWE | CWE-863(授权不正确) |
| 影响 | 频道访问仅由针对 DC_Table CRUD 操作触发的 DataContainer voter 强制执行;newsletter 的 send / importRecipients key-actions 仅在模块级检查之后被分发,因此拥有模块访问权限的非管理员用户可对其权限范围之外的频道发送 newsletter / 导入收件人 |
| 向量 | 已认证的非管理员后端用户调用 newsletter key-action |
| 触发条件 | send key-action 针对权限范围之外的 newsletter 频道 |
存在漏洞的 key-action 在运行时没有进行任何按记录的投票:
// Newsletter::send — pre-fix (dispatched by Backend::getBackendModule)
public function send(DataContainer $dc) {
$db = Database::getInstance(); // no channel access check
...
}
该修复在键操作开始时强制执行按记录投票者:
// 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(...);
}
}
频道访问由 NewsletterChannelAccessVoter /
NewsletterRecipientsAccessVoter 强制执行(需要 USER_CAN_EDIT_CHANNEL)。它们的
supportsType() 仅对在 DC_Table 的创建/编辑/删除方法内分派的 Create/Read/Update/DeleteAction
主体触发。新闻通讯自定义键操作(send、importRecipients)由 Backend::getBackendModule()
在仅经过模块级 USER_CAN_ACCESS_MODULE 检查后直接分派;DC_Table 构造函数不会为键操作运行逐记录的
ReadAction 投票,且 Newsletter.php 不包含
isGranted 检查。因此,拥有新闻通讯模块访问权限的非管理员可以
为其分配范围之外的频道发送新闻通讯或导入收件人。修复方案在 send()
开头添加了 denyAccessUnlessGranted(DC_PREFIX.table, ReadAction(...)),并在 importRecipients() 中添加了 CreateAction 检查
(以及在导入循环中添加逐记录的 CreateAction 检查),从而在键操作路径上强制执行频道
投票器。
| 服务 | 镜像 | 角色 |
|---|---|---|
nl-vuln | cve-2026-104881:vuln | 真实的 Newsletter::send(修复前) |
nl-fixed | cve-2026-104881:fixed | 真实的 send + 辅助程序(供应商修复 1471dcaf) |
poc | cve-2026-104881-poc:local | 仅使用标准库的 Python 驱动程序 |
PHP 测试框架从每个标签逐字加载真实的 send() 方法(对于修复后的构建,还加载
denyAccessUnlessGranted 辅助程序)。由于 PHP 在运行时解析
类,只有被执行的路径需要桩:修复后的 send()
在 denyAccessUnlessGranted(第一行)抛出异常;存在漏洞的 send() 会命中
一个返回 numRows=0 的 Database 模拟对象并提前返回。
security.helper 被模拟为拒绝范围外的频道。两侧仅在
上游方法源代码上有所不同。
./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(仅使用标准库):
send() 继续执行时退出码为 1,被拒绝时为 0;
3 表示无 worker,2 表示不可达/不确定。1471dcaf。一个独立的完整链路利用程序位于 exploit/exploit.py:
python3 exploit/exploit.py --host=nl-vuln
# exit 1 on confirmed access bypass, 0 on a safe target
| 范围 | nl-vuln(修复前) | nl-fixed(1471dcaf) |
|---|---|---|
| 范围外 | 已放行(绕过) | 已拒绝(Not enough permissions to access ReadAction(tl_newsletter)) |
| 范围内(对照) | 已放行(合法) | 已放行(合法) |
捕获的运行记录: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
网络上运行受限容器;实验镜像中使用 PHP 8.3 运行时。USER_CAN_ACCESS_MODULE),但无权访问目标频道。修复后的 send() / importRecipients() 在
关键操作开始时通过 denyAccessUnlessGranted 强制执行按记录
ReadAction / CreateAction 的投票校验,因此范围外的频道会被拒绝,而范围内的访问仍会
放行。收件人导入循环还会针对每条新记录检查 CreateAction。
不再存在关键操作的访问绕过路径。
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)