CVE-2020-18164
📋 TL;DR
This CVE describes a SQL injection vulnerability in tp-shop e-commerce software that allows attackers to execute arbitrary SQL commands through the fBill parameter. Attackers can potentially access, modify, or delete database content. All users running tp-shop versions 2.x-3.x are affected.
💻 Affected Systems
- tp-shop
📦 What is this software?
Tp Shop by Tp Shop
⚠️ Risk & Real-World Impact
Worst Case
Complete database compromise including theft of sensitive customer data, administrative credentials, payment information, and potential remote code execution through database functions.
Likely Case
Data exfiltration of customer information, order details, and potentially administrative credentials leading to site takeover.
If Mitigated
Limited information disclosure if proper input validation and parameterized queries are implemented.
🎯 Exploit Status
Public exploit details available in referenced articles. Simple HTTP requests with crafted fBill parameter can trigger the vulnerability.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Unknown
Vendor Advisory: Not available
Restart Required: No
Instructions:
No official patch available. Consider upgrading to tp-shop 4.x if compatible, or implement workarounds.
🔧 Temporary Workarounds
Input Validation Filter
allAdd server-side validation to reject malicious fBill parameter values
Modify /index.php/home/api/shop controller to validate fBill parameter using regex: /^[a-zA-Z0-9_-]+$/
WAF Rule
allImplement web application firewall rules to block SQL injection patterns
Add WAF rule: deny requests to /index.php/home/api/shop with fBill parameter containing SQL keywords (SELECT, UNION, INSERT, etc.)
🧯 If You Can't Patch
- Implement strict input validation and parameterized queries for all database operations
- Restrict network access to tp-shop administration interface and monitor for suspicious database queries
🔍 How to Verify
Check if Vulnerable:
Send HTTP GET request to /index.php/home/api/shop?fBill=1' AND '1'='1 and check for SQL error responses or unexpected behavior
Check Version:
Check tp-shop version in admin panel or look for version files in installation directory
Verify Fix Applied:
Test with same payload after implementing fixes - should return normal error or no data rather than SQL errors
📡 Detection & Monitoring
Log Indicators:
- Unusual SQL error messages in application logs
- Multiple failed login attempts from single IP
- Database queries with unusual WHERE clauses
Network Indicators:
- HTTP requests to /index.php/home/api/shop with SQL keywords in parameters
- Unusual database connection patterns
SIEM Query:
source="web_logs" AND uri="/index.php/home/api/shop" AND (param="fBill" AND value MATCH "[';]|UNION|SELECT")