CVE-2022-0786

9.8 CRITICAL

📋 TL;DR

This vulnerability allows unauthenticated attackers to execute arbitrary SQL commands on WordPress sites using the KiviCare plugin. It affects all WordPress installations with KiviCare plugin versions before 2.3.9, potentially compromising the entire database.

💻 Affected Systems

Products:
  • KiviCare - Clinic & Patient Management System (EHR)
Versions: All versions before 2.3.9
Operating Systems: All platforms running WordPress
Default Config Vulnerable: ⚠️ Yes
Notes: Affects WordPress installations with the vulnerable plugin enabled. The vulnerable AJAX endpoint is accessible without authentication.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise allowing data theft, modification, or deletion; potential privilege escalation to administrator; possible remote code execution via database functions.

🟠

Likely Case

Unauthenticated attackers extract sensitive data (user credentials, patient records, payment information) and potentially modify database content.

🟢

If Mitigated

With proper input validation and parameterized queries, SQL injection would be prevented entirely.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

SQL injection via the 'get_doctor_details' route in ajax_post AJAX action. Attackers can send crafted HTTP POST requests to wp-admin/admin-ajax.php.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 2.3.9

Vendor Advisory: https://wpscan.com/vulnerability/53f493e9-273b-4349-8a59-f2207e8f8f30

Restart Required: No

Instructions:

1. Log into WordPress admin panel. 2. Navigate to Plugins → Installed Plugins. 3. Find KiviCare plugin. 4. Click 'Update Now' if update available. 5. If no update appears, manually download version 2.3.9+ from WordPress repository.

🔧 Temporary Workarounds

Disable vulnerable AJAX endpoint

linux

Temporarily block access to the vulnerable ajax_post endpoint with get_doctor_details route

Add to .htaccess: RewriteCond %{QUERY_STRING} action=ajax_post.*get_doctor_details [NC] RewriteRule ^wp-admin/admin-ajax\.php$ - [F,L]

Web Application Firewall rule

all

Block SQL injection patterns targeting the vulnerable endpoint

WAF specific - create rule blocking: POST requests to /wp-admin/admin-ajax.php with 'action=ajax_post' and 'route=get_doctor_details' containing SQL keywords

🧯 If You Can't Patch

  • Disable the KiviCare plugin completely until patched
  • Implement strict network ACLs to limit access to wp-admin/admin-ajax.php from untrusted sources

🔍 How to Verify

Check if Vulnerable:

Check WordPress admin panel → Plugins → KiviCare version. If version < 2.3.9, vulnerable.

Check Version:

wp plugin list --name=kivicare --field=version (if WP-CLI installed)

Verify Fix Applied:

Confirm KiviCare plugin version is 2.3.9 or higher in WordPress admin panel.

📡 Detection & Monitoring

Log Indicators:

  • POST requests to /wp-admin/admin-ajax.php with 'action=ajax_post' and 'route=get_doctor_details' containing SQL keywords (UNION, SELECT, INSERT, etc.)
  • Unusual database queries from WordPress application user

Network Indicators:

  • HTTP POST requests to wp-admin/admin-ajax.php with SQL injection payloads in parameters

SIEM Query:

source="web_logs" AND uri="/wp-admin/admin-ajax.php" AND method="POST" AND (params CONTAINS "ajax_post" AND params CONTAINS "get_doctor_details") AND (params CONTAINS "UNION" OR params CONTAINS "SELECT" OR params CONTAINS "INSERT")

🔗 References

📤 Share & Export