CVE-2024-51672

7.6 HIGH

📋 TL;DR

This SQL injection vulnerability in the WordPress BetterLinks plugin allows attackers to execute arbitrary SQL commands on the database. It affects all WordPress sites running BetterLinks versions up to 2.1.7. Attackers could potentially read, modify, or delete database content.

💻 Affected Systems

Products:
  • WordPress BetterLinks Plugin
Versions: n/a through 2.1.7
Operating Systems: Any OS running WordPress
Default Config Vulnerable: ⚠️ Yes
Notes: Affects all WordPress installations with vulnerable BetterLinks versions installed and activated.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise including data theft, data destruction, privilege escalation to administrator, and potential remote code execution through database functions.

🟠

Likely Case

Unauthorized data access, extraction of sensitive information like user credentials, and potential site defacement.

🟢

If Mitigated

Limited impact with proper input validation and database permissions, potentially only allowing data reading from specific tables.

🌐 Internet-Facing: HIGH - WordPress plugins are typically internet-facing and this vulnerability requires no authentication.
🏢 Internal Only: LOW - Internal-only WordPress instances would still be vulnerable but have reduced attack surface.

🎯 Exploit Status

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

SQL injection vulnerabilities in WordPress plugins are commonly exploited, and public details exist on Patchstack.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 2.1.8 or later

Vendor Advisory: https://patchstack.com/database/vulnerability/betterlinks/wordpress-betterlinks-plugin-2-1-7-sql-injection-vulnerability?_s_id=cve

Restart Required: No

Instructions:

1. Log into WordPress admin panel. 2. Navigate to Plugins → Installed Plugins. 3. Find BetterLinks and click 'Update Now'. 4. Verify version is 2.1.8 or higher.

🔧 Temporary Workarounds

Disable BetterLinks Plugin

all

Temporarily deactivate the plugin until patched

wp plugin deactivate betterlinks

Web Application Firewall Rules

all

Implement WAF rules to block SQL injection patterns targeting BetterLinks endpoints

🧯 If You Can't Patch

  • Implement strict input validation and parameterized queries at application level
  • Restrict database user permissions to minimum required for BetterLinks functionality

🔍 How to Verify

Check if Vulnerable:

Check WordPress admin → Plugins → BetterLinks → Version. If version is 2.1.7 or lower, you are vulnerable.

Check Version:

wp plugin get betterlinks --field=version

Verify Fix Applied:

Verify BetterLinks version is 2.1.8 or higher in WordPress admin plugins page.

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL queries in database logs
  • Multiple failed login attempts from single IP
  • Unexpected wp-admin or wp-json requests

Network Indicators:

  • SQL syntax in HTTP parameters
  • Unusual traffic to /wp-json/betterlinks/ endpoints
  • Database connection spikes

SIEM Query:

source="web_logs" AND (uri="*betterlinks*" AND (param="*' OR *" OR param="*;--*" OR param="*UNION*"))

🔗 References

📤 Share & Export