CVE-2020-19216
📋 TL;DR
This CVE describes an SQL injection vulnerability in Piwigo's admin/user_perm.php file via the cat_false parameter. Attackers can execute arbitrary SQL commands on the database, potentially compromising the entire Piwigo installation. Only administrators with access to the group permissions page are affected.
💻 Affected Systems
- Piwigo
📦 What is this software?
Piwigo by Piwigo
⚠️ Risk & Real-World Impact
Worst Case
Complete database compromise leading to data theft, privilege escalation, or full system takeover via subsequent attacks.
Likely Case
Unauthorized data access, modification of user permissions, or extraction of sensitive information from the database.
If Mitigated
Limited impact if proper input validation and parameterized queries are implemented.
🎯 Exploit Status
Exploitation requires admin authentication but uses simple SQL injection techniques.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: v2.10.0 and later
Vendor Advisory: https://github.com/Piwigo/Piwigo/issues/1011
Restart Required: No
Instructions:
1. Backup your Piwigo installation and database. 2. Download Piwigo v2.10.0 or later from the official repository. 3. Replace the affected files with patched versions. 4. Verify the fix by testing the vulnerable endpoint.
🔧 Temporary Workarounds
Input Validation Filter
allAdd input validation to sanitize the cat_false parameter before processing
Modify admin/user_perm.php to validate cat_false parameter as integer using is_numeric() or filter_var()
Access Restriction
allRestrict access to admin interface to trusted IP addresses only
Add IP whitelisting to .htaccess or web server configuration for /admin directory
🧯 If You Can't Patch
- Implement web application firewall (WAF) rules to block SQL injection patterns targeting the cat_false parameter
- Disable or restrict admin user accounts to minimize attack surface
🔍 How to Verify
Check if Vulnerable:
Test the /admin.php?page=group_perm endpoint with SQL injection payloads in the cat_false parameter while authenticated as admin
Check Version:
Check Piwigo version in admin dashboard or examine includes/constants.php for version number
Verify Fix Applied:
Attempt the same SQL injection tests after patching; successful queries should be blocked or sanitized
📡 Detection & Monitoring
Log Indicators:
- Unusual SQL queries in database logs
- Multiple failed login attempts followed by admin.php access
- cat_false parameter containing SQL keywords in web server logs
Network Indicators:
- HTTP requests to /admin.php?page=group_perm with suspicious cat_false values
- Unusual database connection patterns from web server
SIEM Query:
source="web_logs" AND uri="/admin.php" AND query="*cat_false=*" AND (query="*SELECT*" OR query="*UNION*" OR query="*OR*1=1*")