CVE-2018-5981
📋 TL;DR
This SQL injection vulnerability in Gallery WD 1.3.6 for Joomla! allows attackers to execute arbitrary SQL commands via the tag_id or gallery_id parameters. This affects all Joomla! installations using the vulnerable Gallery WD component version. Attackers can potentially access, modify, or delete database content.
💻 Affected Systems
- Gallery WD for Joomla!
📦 What is this software?
Gallery Wd by Web Dorado
⚠️ Risk & Real-World Impact
Worst Case
Complete database compromise leading to data theft, data destruction, or full system takeover via SQL injection to RCE chaining
Likely Case
Database information disclosure, authentication bypass, or data manipulation
If Mitigated
Limited impact with proper input validation and parameterized queries in place
🎯 Exploit Status
Public exploit code available on Exploit-DB, requires minimal technical skill to execute
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 1.3.7 or later
Vendor Advisory: https://extensions.joomla.org/extension/gallery-wd/
Restart Required: No
Instructions:
1. Update Gallery WD component to version 1.3.7 or later via Joomla! Extension Manager. 2. Verify update completes successfully. 3. Clear Joomla! cache.
🔧 Temporary Workarounds
WAF Rule Implementation
allDeploy web application firewall rules to block SQL injection patterns in tag_id and gallery_id parameters
Input Validation Filter
allImplement input validation to restrict tag_id and gallery_id parameters to expected formats
🧯 If You Can't Patch
- Disable or remove Gallery WD component entirely
- Implement strict network segmentation and restrict access to affected systems
🔍 How to Verify
Check if Vulnerable:
Check Joomla! Extension Manager for Gallery WD version. If version is 1.3.6 or earlier, system is vulnerable.
Check Version:
Check via Joomla! admin panel: Extensions → Manage → Manage
Verify Fix Applied:
Confirm Gallery WD version is 1.3.7 or later in Joomla! Extension Manager
📡 Detection & Monitoring
Log Indicators:
- Unusual SQL error messages in web logs
- Multiple requests with SQL injection patterns in parameters
- Unexpected database queries from web application
Network Indicators:
- HTTP requests containing SQL keywords in tag_id or gallery_id parameters
- Unusual database connection patterns from web server
SIEM Query:
web.url:*tag_id=*SELECT* OR web.url:*gallery_id=*UNION* OR web.url:*tag_id=*OR*1=1*