| CVE | CVE-2026-115463 |
| 组件 | Poweradmin — lib/Domain/Service/MfaService.php(generateEmailVerificationCode()、verifyCode()) |
| 受影响版本 | 4.0.0 – 4.2.5、4.3.0 – 4.3.4、4.4.0 |
| 修复版本 | 4.2.6 / 4.3.5 / 4.4.1 — 提交 021e5fea(GHSA-9657-8vc2-7g2p) |
| CWE | CWE-338(密码学弱伪随机数生成器)、CWE-307(认证尝试次数过多) |
| 影响 | 知道用户密码的攻击者可以预测 6 位邮件第二因素验证码——mt_rand() 状态可从攻击者自己账户生成的验证码中恢复——并且 verifyCode() 未设置失败尝试次数限制,因此第二因素可被绕过 |
| 攻击向量 | 网络——MFA 邮件验证码验证端点,持有密码的攻击者 |
| 触发方式 | 从自行生成的验证码中恢复 mt_rand 状态,预测受害者的验证码,然后提交该验证码 |
存在漏洞的生成器使用 mt_rand() 生成邮件第二因素验证码:
// pre-fix MfaService::generateEmailVerificationCode()
$numericCode = mt_rand(100000, 999999);
return (string)$numericCode;
修复方案改用 CSPRNG,并限制验证尝试次数:
// fixed (commit 021e5fea)
return (string)random_int(100000, 999999);
// plus: MAX_VERIFY_ATTEMPTS = 5, VERIFY_LOCKOUT_SECONDS = 900
mt_rand() 是一个 Mersenne Twister 伪随机数生成器,而非密码学安全的生成器。其内部状态可以从少量观测输出中恢复;攻击者只要拥有自己的 Poweradmin 账户,就可以不断生成邮件验证码,直到恢复该状态,然后计算出服务器将为任何其他用户生成的精确验证码。由于 verifyCode() 在验证码有效期内还接受无限次失败猜测,即使只掌握部分状态,也足以遍历剩余空间。修复方案将生成器替换为 random_int()(CSPRNG),并在 5 次失败尝试后拒绝验证,持续 900 秒。
| 服务 | 镜像 | 角色 |
|---|---|---|
pa-vuln | cve-2026-115463:vuln | 来自 021e5fea^ 的真实 MfaService.php(修复前) |
pa-fixed | cve-2026-115463:fixed | 来自 021e5fea 的真实 MfaService.php(厂商修复) |
poc | cve-2026-115463-poc:local | 仅使用标准库的 Python 驱动程序 |
一个 PHP 测试框架通过反射实例化真实的 MfaService,设置 mt_srand(12345) 的种子,计算攻击者基于该种子所能做出的预测,重新设置种子,并调用真实的 generateEmailVerificationCode()。两侧唯一的区别在于上游的 MfaService.php 源代码。
./run-lab.sh build # builds both sides (php:8.3-cli)
./run-lab.sh up # cve115463lab network: pa-vuln / pa-fixed
./run-lab.sh sweep
./run-lab.sh down
poc/poc.py(仅使用标准库):
021e5fea 之后的版本(4.2.6 / 4.3.5 / 4.4.1)。一个独立的完整链路利用程序位于 exploit/exploit.py:
python3 exploit/exploit.py --host=pa-vuln
# exit 1 on confirmed predictability, 0 on a safe target
| 观察项 | pa-vuln(修复前) | pa-fixed(021e5fea) |
|---|---|---|
| 种子预测 | 370690 | 370690 |
| 生成的邮件验证码 | 370690 — 可预测 | 随机(例如 157533)— 不可预测 |
捕获的运行记录: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。
cve115463lab
网络上运行受限容器。修复后的代码从 random_int()(CSPRNG)获取邮件验证码;基于种子的 mt_rand 预测永远无法匹配。生成器不再泄露
PRNG 状态,并且该修复还额外限制了验证尝试次数(5 次),并设置
900 秒锁定,从而关闭了对有效验证码的暴力破解窗口。
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 source
lab/vendor/ real MfaService.php at pre-fix / fix commits
lab/harness.php reflection harness calling the real generator
lab/service.py HTTP wrapper (POST /code)
evidence/ captured runs of every mode on both sides
TRACKING.md excluded (working record)