CVE-2020-18164

9.8 CRITICAL

📋 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

Products:
  • tp-shop
Versions: 2.x-3.x
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Affects the /index.php/home/api/shop endpoint with fBill parameter. No special configuration required.

📦 What is this software?

⚠️ 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.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

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

all

Add 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

all

Implement 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")

🔗 References

📤 Share & Export