CVE-2024-6666
📋 TL;DR
This SQL injection vulnerability in the WP ERP WordPress plugin allows authenticated attackers with Accounting Manager privileges to inject malicious SQL queries via the 'vendor_id' parameter. This can lead to unauthorized data extraction from the database, potentially exposing sensitive information. All WordPress sites using WP ERP versions up to 1.13.0 are affected.
💻 Affected Systems
- WP ERP WordPress Plugin
📦 What is this software?
Wp Erp by Wedevs
⚠️ Risk & Real-World Impact
Worst Case
Complete database compromise including extraction of sensitive user data, financial records, and potential privilege escalation to full site control.
Likely Case
Extraction of sensitive business data, customer information, and financial records from the database.
If Mitigated
Limited impact due to proper access controls and network segmentation, with only authorized users able to exploit the vulnerability.
🎯 Exploit Status
Exploitation requires authenticated access but SQL injection is straightforward once authenticated with appropriate privileges.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 1.13.1
Vendor Advisory: https://plugins.trac.wordpress.org/changeset/3064874/erp/tags/1.13.1/modules/accounting/includes/functions/transactions.php
Restart Required: No
Instructions:
1. Log into WordPress admin panel. 2. Navigate to Plugins → Installed Plugins. 3. Find WP ERP plugin. 4. Click 'Update Now' if update is available. 5. Alternatively, download version 1.13.1+ from WordPress repository and manually update.
🔧 Temporary Workarounds
Temporary Access Restriction
allRestrict access to Accounting Manager roles to trusted users only until patch is applied.
Web Application Firewall Rule
allImplement WAF rules to block SQL injection patterns in vendor_id parameter.
🧯 If You Can't Patch
- Implement strict principle of least privilege for Accounting Manager roles
- Deploy network segmentation to isolate the WordPress instance from sensitive databases
🔍 How to Verify
Check if Vulnerable:
Check WP ERP plugin version in WordPress admin panel under Plugins → Installed Plugins.
Check Version:
wp plugin list --name='WP ERP' --field=version
Verify Fix Applied:
Verify plugin version is 1.13.1 or higher and review the transactions.php file for proper parameter sanitization.
📡 Detection & Monitoring
Log Indicators:
- Unusual SQL queries in database logs
- Multiple failed login attempts followed by Accounting Manager access
- Unusual vendor_id parameter values in web server logs
Network Indicators:
- SQL error messages in HTTP responses
- Unusual database query patterns from WordPress instance
SIEM Query:
source="web_server" AND (vendor_id CONTAINS "' OR" OR vendor_id CONTAINS "UNION" OR vendor_id CONTAINS "SELECT")
🔗 References
- https://plugins.trac.wordpress.org/changeset/3064874/erp/tags/1.13.1/modules/accounting/includes/functions/transactions.php
- https://www.wordfence.com/threat-intel/vulnerabilities/id/e23335c9-0830-4c6b-8e0d-6897a7176ba5?source=cve
- https://plugins.trac.wordpress.org/changeset/3064874/erp/tags/1.13.1/modules/accounting/includes/functions/transactions.php
- https://www.wordfence.com/threat-intel/vulnerabilities/id/e23335c9-0830-4c6b-8e0d-6897a7176ba5?source=cve