CVE-2020-5504

8.8 HIGH

📋 TL;DR

This SQL injection vulnerability in phpMyAdmin allows authenticated attackers to inject malicious SQL queries through the username field on the user accounts page. Attackers can potentially read, modify, or delete database data. Only users with valid MySQL credentials can exploit this vulnerability.

💻 Affected Systems

Products:
  • phpMyAdmin
Versions: phpMyAdmin 4.x before 4.9.4, phpMyAdmin 5.x before 5.0.1
Operating Systems: All operating systems running affected phpMyAdmin versions
Default Config Vulnerable: ⚠️ Yes
Notes: Requires attacker to have valid MySQL credentials; affects all phpMyAdmin installations with default configurations.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise including data theft, modification, or deletion; potential privilege escalation to database administrator; possible server compromise if database permissions allow file system access.

🟠

Likely Case

Unauthorized data access and manipulation within the attacker's privilege scope; extraction of sensitive information from accessible database tables.

🟢

If Mitigated

Limited impact due to proper access controls and network segmentation; attacker confined to their own database privileges.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Exploitation requires authenticated access; proof-of-concept code is publicly available; SQL injection is a well-understood attack vector.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: phpMyAdmin 4.9.4 or 5.0.1

Vendor Advisory: https://www.phpmyadmin.net/security/PMASA-2020-1/

Restart Required: No

Instructions:

1. Backup your phpMyAdmin configuration and database. 2. Download the patched version from phpmyadmin.net. 3. Replace the existing phpMyAdmin installation with the patched version. 4. Verify the installation works correctly.

🔧 Temporary Workarounds

Restrict Access

all

Limit phpMyAdmin access to trusted IP addresses only

# In Apache: Require ip 192.168.1.0/24
# In Nginx: allow 192.168.1.0/24; deny all;

Disable User Accounts Page

all

Remove or restrict access to the vulnerable user accounts functionality

# Add to phpMyAdmin config.inc.php: $cfg['Servers'][$i]['AllowUserManagement'] = false;

🧯 If You Can't Patch

  • Implement strict network access controls to limit phpMyAdmin access to authorized users only
  • Apply principle of least privilege to MySQL user accounts to limit potential damage

🔍 How to Verify

Check if Vulnerable:

Check phpMyAdmin version in the interface footer or via version.php file

Check Version:

grep -i 'version' /path/to/phpmyadmin/libraries/classes/Version.php | head -1

Verify Fix Applied:

Confirm phpMyAdmin version is 4.9.4+ or 5.0.1+ and test user account functionality

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL queries in MySQL logs
  • Multiple failed login attempts followed by user account modifications
  • SQL syntax errors in phpMyAdmin logs

Network Indicators:

  • SQL injection patterns in HTTP requests to phpMyAdmin
  • Unusual database query patterns from phpMyAdmin IP

SIEM Query:

source="phpmyadmin.log" AND ("user accounts" OR "CREATE USER" OR "ALTER USER") AND (UNION SELECT OR 1=1 OR ' OR ")

🔗 References

📤 Share & Export