CVE-2024-28107
📋 TL;DR
A SQL injection vulnerability in phpMyFAQ allows authenticated users with FAQ news editing permissions to execute arbitrary SQL commands. This can lead to data exfiltration, account takeover, and potentially remote code execution. All phpMyFAQ installations below version 3.2.6 are affected.
💻 Affected Systems
- phpMyFAQ
📦 What is this software?
Phpmyfaq by Phpmyfaq
⚠️ Risk & Real-World Impact
Worst Case
Attackers achieve remote code execution, compromise the entire database, and take over the server hosting phpMyFAQ.
Likely Case
Attackers exfiltrate sensitive data including user credentials, modify FAQ content, and escalate privileges.
If Mitigated
Attackers can only access data within their permission scope, limited by proper input validation and database permissions.
🎯 Exploit Status
Exploitation requires authenticated access but SQL injection is straightforward once authenticated with appropriate permissions.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 3.2.6
Vendor Advisory: https://github.com/thorsten/phpMyFAQ/security/advisories/GHSA-2grw-mc9r-822r
Restart Required: No
Instructions:
1. Backup your phpMyFAQ installation and database. 2. Download phpMyFAQ 3.2.6 or newer from the official repository. 3. Replace the existing installation files with the patched version. 4. Verify the update was successful by checking the version in the admin panel.
🔧 Temporary Workarounds
Restrict User Permissions
allTemporarily remove FAQ news editing permissions from non-essential users until patching is complete.
Web Application Firewall Rules
allImplement WAF rules to block SQL injection patterns in email parameter inputs.
🧯 If You Can't Patch
- Implement strict input validation for email fields using allow-lists for characters
- Apply principle of least privilege to database user accounts used by phpMyFAQ
🔍 How to Verify
Check if Vulnerable:
Check phpMyFAQ version in admin panel or by examining the source code. Versions below 3.2.6 are vulnerable.
Check Version:
Check the version.php file or admin dashboard for version information.
Verify Fix Applied:
Confirm version is 3.2.6 or higher in admin panel and verify the commit d0fae62a72615d809e6710861c1a7f67ac893007 is present.
📡 Detection & Monitoring
Log Indicators:
- Unusual SQL queries in database logs
- Multiple failed login attempts followed by FAQ news editing activity
- Suspicious email parameter values in web server logs
Network Indicators:
- Unusual database connections from web server
- Large data transfers from database to unexpected destinations
SIEM Query:
source="web_server" AND (email LIKE "%'%" OR email LIKE "%--%" OR email LIKE "%;%") AND uri="/admin/index.php?action=saveentry"
🔗 References
- https://github.com/thorsten/phpMyFAQ/commit/d0fae62a72615d809e6710861c1a7f67ac893007
- https://github.com/thorsten/phpMyFAQ/security/advisories/GHSA-2grw-mc9r-822r
- https://github.com/thorsten/phpMyFAQ/commit/d0fae62a72615d809e6710861c1a7f67ac893007
- https://github.com/thorsten/phpMyFAQ/security/advisories/GHSA-2grw-mc9r-822r