HasConfirmation 实现任意 Livewire 方法调用| CVE | CVE-2026-103026 |
| 组件 | Paymenter — app/Livewire/Traits/HasConfirmation.php、app/Livewire/Component.php |
| 受影响版本 | e0c04af 之前的版本 |
| 修复于 | 提交 e0c04af(Merge commit from fork,GHSA-prhx-9q2h-ph2x) |
| CWE | CWE-470(使用外部可控输入选择类或代码)、CWE-862(缺少授权) |
| 影响 | 基础 Livewire Component 所使用的 HasConfirmation trait 暴露了公共操作 confirmAction() 和 executeConfirmedAction($action, $parameters)。后者会调用由调用方通过 method_exists() 选定的组件上的任意方法——参数由攻击者控制,没有授权检查,也未强制要求确认。攻击者可调用公共方法来覆盖锁定数据、作废发票或以其他方式篡改特权状态。该漏洞可通过 Livewire 的公共操作调度器触达,即任何能够访问受影响组件的调用方均可利用 |
| 向量 | Livewire 操作调用 executeConfirmedAction,携带任意方法名和参数 |
| 触发条件 | executeConfirmedAction('updateServerSettings', [...]) |
该 trait 的通用调度器:
// HasConfirmation.php — pre-fix (verbatim)
public function executeConfirmedAction($action, $parameters = [])
{
if (method_exists($this, $action)) {
return $this->{$action}(...$parameters);
}
throw new \Exception("Method {$action} does not exist");
}
该修复删除了该 trait,并将其从基础组件中移除:
// Component.php — fixed
-use Disabled, HasConfirmation, HasNotifications;
+use Disabled, HasNotifications;
Livewire 将组件的公共方法暴露为可调用的操作。通过将
HasConfirmation 混入基础 Component,Paymenter 中的每个组件
都继承了两个公共操作。executeConfirmedAction 从
请求中获取方法名,并以 method_exists() 作为唯一检查来调用它——没有
允许列表,没有授权检查,而“确认”步骤仅仅是
客户端分发。上游修复完全移除了该 trait,因此
通用分发器在任何组件上都不再可达。
| 服务 | 镜像 | 角色 |
|---|---|---|
py-vuln | cve-2026-103026:vuln | 逐字复制自 e0c04af^ 的 HasConfirmation trait |
py-fixed | cve-2026-103026:fixed | 已删除 trait(与 e0c04af 一致) |
poc | cve-2026-103026-poc:local | 仅使用标准库的 Python 驱动程序 |
PHP 测试框架在易受攻击的一侧加载逐字删除的 trait,并在
修复后的一侧省略它。一个桩组件模拟特权方法
(updateServerSettings、voidInvoice),其副作用记录在
状态中;两种模式显示相同的操作调用成功或不可达。
./run-lab.sh build # builds both sides (php:8.3-alpine + python3 service)
./run-lab.sh up # cve103026lab network: py-vuln / py-fixed
./run-lab.sh sweep
./run-lab.sh down
poc/poc.py(仅使用标准库):
method_exists 分发 → 以攻击者参数调用特权方法 → 状态被覆盖。e0c04af / 移除 trait。一个独立的完整攻击链利用程序位于 exploit/exploit.py:
python3 exploit/exploit.py --host=py-vuln
# exit 1 on confirmed arbitrary invocation, 0 on a safe target
| 模式 | py-vuln (e0c04af^) | py-fixed (e0c04af) |
|---|---|---|
executeConfirmedAction('updateServerSettings', ...) | action 暴露;settings_overwritten: true | 不存在该 Livewire action;无状态变更 |
executeConfirmedAction('voidInvoice', ...) | action 暴露;invoice_voided: true | 不存在该 Livewire action |
已捕获的运行: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。
cve103026lab
网络上运行的有界容器;实验镜像中使用 PHP 8.3 CLI。Component 的 Livewire 组件。从基础组件中删除该 trait 会一次性移除所有 Livewire 组件的两个公共分发 辅助方法;没有其他同级 trait 暴露可比的通用方法分发器。修复后的测试环境 确认,普通组件方法在被直接调用时仍然正常工作——仅移除了任意分发 面。
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/harness-*.php verbatim trait (vuln) / trait removed (fixed)
lab/lab.Dockerfile builds both sides from the pinned upstream source slices
lab/service.py HTTP wrapper (POST /call), child-process isolation
evidence/ captured runs of every mode on both sides
TRACKING.md excluded (working record)