CVE-2024-8484

7.5 HIGH

📋 TL;DR

This SQL injection vulnerability in the REST API TO MiniProgram WordPress plugin allows unauthenticated attackers to inject malicious SQL queries through the 'order' parameter. Attackers can extract sensitive information from the database, including user credentials and other confidential data. All WordPress sites using this plugin up to version 4.7.1 are affected.

💻 Affected Systems

Products:
  • REST API TO MiniProgram WordPress plugin
Versions: All versions up to and including 4.7.1
Operating Systems: All operating systems running WordPress
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability exists in default plugin configuration when the REST API endpoint is accessible.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise leading to credential theft, data exfiltration, privilege escalation, and potential site takeover.

🟠

Likely Case

Extraction of sensitive user data, admin credentials, and other database contents leading to further attacks.

🟢

If Mitigated

Limited impact with proper input validation, parameterized queries, and database user privilege restrictions.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

SQL injection via REST API endpoint requires no authentication and uses simple parameter manipulation.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 4.7.2 or later

Vendor Advisory: https://plugins.trac.wordpress.org/changeset/3158475/rest-api-to-miniprogram/tags/4.7.2/

Restart Required: No

Instructions:

1. Log into WordPress admin panel. 2. Navigate to Plugins. 3. Find REST API TO MiniProgram. 4. Click 'Update Now' if update available. 5. If no update available, deactivate and delete plugin, then install fresh version 4.7.2+.

🔧 Temporary Workarounds

Disable vulnerable REST endpoint

all

Block access to the vulnerable API endpoint using web server configuration or WordPress filters.

# Apache .htaccess
RewriteRule ^wp-json/watch-life-net/v1/comment/getcomments - [F,L]
# Nginx
location ~* ^/wp-json/watch-life-net/v1/comment/getcomments { deny all; }

Input validation filter

all

Add WordPress filter to sanitize 'order' parameter before processing.

add_filter('rest_pre_dispatch', function($result, $server, $request) {
    if ($request->get_route() === '/watch-life-net/v1/comment/getcomments') {
        $order = $request->get_param('order');
        if ($order && !in_array(strtoupper($order), ['ASC', 'DESC'])) {
            return new WP_Error('invalid_order', 'Invalid order parameter');
        }
    }
    return $result;
}, 10, 3);

🧯 If You Can't Patch

  • Deactivate and remove the REST API TO MiniProgram plugin immediately
  • Implement WAF rules to block SQL injection patterns targeting the vulnerable endpoint

🔍 How to Verify

Check if Vulnerable:

Check WordPress admin panel > Plugins > REST API TO MiniProgram version. If version is 4.7.1 or lower, you are vulnerable.

Check Version:

# WordPress CLI
wp plugin list --name='REST API TO MiniProgram' --field=version
# Or check wp-content/plugins/rest-api-to-miniprogram/readme.txt

Verify Fix Applied:

After updating, verify plugin version shows 4.7.2 or higher in WordPress admin panel.

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL queries in database logs
  • Multiple requests to /wp-json/watch-life-net/v1/comment/getcomments with SQL keywords in parameters
  • Database error logs showing SQL syntax errors

Network Indicators:

  • HTTP POST/GET requests to vulnerable endpoint with SQL injection payloads in 'order' parameter
  • Unusual traffic patterns to REST API endpoints

SIEM Query:

source="web_access_logs" AND (url_path="/wp-json/watch-life-net/v1/comment/getcomments" AND (query_string="*order=*SELECT*" OR query_string="*order=*UNION*" OR query_string="*order=*OR*"))

🔗 References

📤 Share & Export