CVE-2020-19216

8.8 HIGH

📋 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

Products:
  • Piwigo
Versions: v2.9.5 and possibly earlier versions
Operating Systems: All platforms running Piwigo
Default Config Vulnerable: ⚠️ Yes
Notes: Requires admin access to the group permissions page (/admin.php?page=group_perm)

📦 What is this software?

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

🌐 Internet-Facing: HIGH if admin interface is exposed to internet, as authenticated admins could be targeted.
🏢 Internal Only: MEDIUM if admin interface is internal-only, requiring attacker to already have network access.

🎯 Exploit Status

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

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

all

Add 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

all

Restrict 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*")

🔗 References

📤 Share & Export