CVE-2018-16354
📋 TL;DR
This vulnerability allows attackers to execute arbitrary SQL commands through the 'limit' parameter in FHCRM's index.php/User/read endpoint. It affects all FHCRM deployments through version 2018-02-11. Attackers can potentially access, modify, or delete database content.
💻 Affected Systems
- FHCRM
📦 What is this software?
Fhcrm by Fhcrm Project
⚠️ Risk & Real-World Impact
Worst Case
Complete database compromise leading to data theft, data destruction, or remote code execution via database functions.
Likely Case
Unauthorized data access, privilege escalation, or data manipulation in the FHCRM database.
If Mitigated
Limited impact with proper input validation and parameterized queries in place.
🎯 Exploit Status
SQL injection via GET/POST parameter requires minimal technical skill. Public GitHub issue demonstrates the vulnerability.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Versions after 2018-02-11
Vendor Advisory: https://github.com/focalhot/FHCRM/issues/4
Restart Required: No
Instructions:
1. Update FHCRM to version after 2018-02-11. 2. Apply proper input validation and parameterized queries to the index.php/User/read endpoint. 3. Test the fix by attempting SQL injection.
🔧 Temporary Workarounds
Web Application Firewall (WAF)
allDeploy a WAF with SQL injection protection rules to block malicious requests.
Input Validation Filter
allImplement server-side validation to reject non-numeric values in the 'limit' parameter.
🧯 If You Can't Patch
- Isolate the FHCRM system from untrusted networks using firewall rules.
- Implement strict access controls and monitor for unusual database queries.
🔍 How to Verify
Check if Vulnerable:
Test the index.php/User/read endpoint with SQL injection payloads in the 'limit' parameter (e.g., '1 OR 1=1').
Check Version:
Check FHCRM version in admin panel or configuration files.
Verify Fix Applied:
Attempt SQL injection after patching; successful queries should be blocked or sanitized.
📡 Detection & Monitoring
Log Indicators:
- Unusual SQL queries in application logs
- Multiple failed login attempts via User/read endpoint
Network Indicators:
- HTTP requests to index.php/User/read with SQL syntax in parameters
SIEM Query:
source="web_logs" AND uri="*index.php/User/read*" AND (param="*limit=*OR*" OR param="*limit=*UNION*" OR param="*limit=*SELECT*")