CVE-2020-26935

9.8 CRITICAL

📋 TL;DR

This SQL injection vulnerability in phpMyAdmin's search feature allows attackers to inject malicious SQL queries. It affects all phpMyAdmin installations before version 4.9.6 and 5.x before 5.0.3. Attackers could potentially read, modify, or delete database contents.

💻 Affected Systems

Products:
  • phpMyAdmin
Versions: All versions before 4.9.6 and 5.x before 5.0.3
Operating Systems: All operating systems running phpMyAdmin
Default Config Vulnerable: ⚠️ Yes
Notes: Affects all installations with the search feature enabled, which is default.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise including data theft, data destruction, privilege escalation to database administrator, and potential server takeover via SQL injection to RCE chain.

🟠

Likely Case

Unauthorized data access, data manipulation, privilege escalation within the database, and potential exposure of sensitive information.

🟢

If Mitigated

Limited impact with proper input validation, parameterized queries, and least privilege database accounts.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Exploitation requires authentication to phpMyAdmin but not necessarily database admin privileges. SQL injection is well-understood and weaponization is likely.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 4.9.6 or 5.0.3

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

Restart Required: No

Instructions:

1. Backup your phpMyAdmin configuration and databases. 2. Download phpMyAdmin 4.9.6 or 5.0.3 from official sources. 3. Replace existing phpMyAdmin installation with patched version. 4. Verify functionality.

🔧 Temporary Workarounds

Disable Search Feature

all

Temporarily disable the search functionality in phpMyAdmin to prevent exploitation.

Edit config.inc.php and add: $cfg['Servers'][$i]['AllowSearch'] = false;

Restrict Access

all

Limit phpMyAdmin access to trusted IP addresses only.

Add to .htaccess: Require ip 192.168.1.0/24
Or configure web server ACLs

🧯 If You Can't Patch

  • Implement web application firewall (WAF) rules to block SQL injection patterns
  • Restrict database user permissions to minimum required (SELECT only if possible)

🔍 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.6 or higher for 4.x series, or 5.0.3 or higher for 5.x series.

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL queries in phpMyAdmin logs
  • Multiple failed search attempts
  • SQL syntax errors in web server logs

Network Indicators:

  • POST requests to search.php with SQL keywords
  • Unusual database query patterns from web server

SIEM Query:

source="*phpmyadmin*" AND ("UNION" OR "SELECT *" OR "information_schema" OR "--" OR "/*")

🔗 References

📤 Share & Export