CVE-2020-10802

8.0 HIGH

📋 TL;DR

This SQL injection vulnerability in phpMyAdmin allows attackers to execute arbitrary SQL queries by crafting malicious database or table names. Users running affected versions who perform search operations on these malicious databases/tables are vulnerable. The vulnerability stems from improper escaping of parameters in search functionality.

💻 Affected Systems

Products:
  • phpMyAdmin
Versions: 4.x before 4.9.5, 5.x before 5.0.2
Operating Systems: All operating systems running phpMyAdmin
Default Config Vulnerable: ⚠️ Yes
Notes: Requires user interaction - victim must perform search operations on malicious database/table names crafted by attacker.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise including data theft, modification, deletion, or potential server takeover via SQL injection leading to remote code execution.

🟠

Likely Case

Unauthorized data access, data manipulation, privilege escalation within the database, and potential information disclosure.

🟢

If Mitigated

Limited impact with proper input validation, parameterized queries, and database user privilege restrictions in place.

🌐 Internet-Facing: HIGH - phpMyAdmin is commonly exposed to the internet for database management, making it a prime target.
🏢 Internal Only: MEDIUM - Internal attackers or compromised internal systems could exploit this to escalate privileges or move laterally.

🎯 Exploit Status

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

Exploitation requires attacker to create malicious database/table names and victim to perform search operations on them. Multiple security advisories indicate active awareness.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 4.9.5 for 4.x branch, 5.0.2 for 5.x branch

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

Restart Required: No

Instructions:

1. Backup your phpMyAdmin configuration and database. 2. Download latest patched version from phpmyadmin.net. 3. Replace existing phpMyAdmin files with patched version. 4. Clear browser cache and verify functionality.

🔧 Temporary Workarounds

Restrict Database/Table Creation

all

Limit database/table creation privileges to trusted administrators only

GRANT CREATE ON *.* TO 'admin_user'@'localhost';
REVOKE CREATE ON *.* FROM 'regular_user'@'%';

Disable Search Functionality

all

Temporarily disable table search functionality in phpMyAdmin configuration

Add $cfg['Servers'][$i]['AllowUserDropDatabase'] = false; to config.inc.php

🧯 If You Can't Patch

  • Implement strict input validation for database and table names
  • Restrict phpMyAdmin access to trusted IP addresses only using .htaccess or firewall rules

🔍 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:

Verify version is 4.9.5 or higher for 4.x branch, or 5.0.2 or higher for 5.x branch

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL queries in database logs
  • Multiple failed search attempts
  • Database/table creation from unexpected sources

Network Indicators:

  • SQL error messages in HTTP responses
  • Unusual patterns in phpMyAdmin search requests

SIEM Query:

source="phpmyadmin.log" AND ("SQL syntax" OR "You have an error in your SQL syntax")

🔗 References

📤 Share & Export