CVE-2020-5504: phpMyAdmin SQL injection in user accounts page

phpmyadmin/phpmyadmin Updated 02 Oct 2025

Summary

24/05/2022
Yes i
High
8.8

CVE-2020-5504: phpMyAdmin SQL injection in user accounts page. Affects phpmyadmin/phpmyadmin across 2 version ranges.

>= 4.0.0, < 4.9.4 >= 5.0.0, < 5.0.1

Fixed in 4.9.4 or 5.0.1, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2020-5504 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

phpMyAdmin is a popular open-source tool written in PHP that is used for managing MySQL databases. It provides a web-based interface for performing various database administration tasks such as creating, modifying, and deleting databases, tables, and users. The vulnerability identified as CVE-2020-5504 affects phpMyAdmin versions 4 before 4.9.4 and 5 before 5.0.1. This vulnerability allows an attacker to perform SQL injection attacks on the user accounts page of phpMyAdmin. To exploit this vulnerability, the attacker needs a valid MySQL account to access the server.

Vulnerability Detail

The vulnerability in phpMyAdmin allows a malicious user to inject custom SQL code in place of their own username when creating queries on the user accounts page. This can lead to unauthorized access to the database and potential data leakage or modification. The vulnerability is classified as CWE-89, which refers to SQL injection attacks. The severity of this vulnerability is rated as HIGH with a CVSS score of 8.8.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • >= 4.0.0, < 4.9.4 4.9.4
    composer require phpmyadmin/phpmyadmin:4.9.4
  • >= 5.0.0, < 5.0.1 5.0.1
    composer require phpmyadmin/phpmyadmin:5.0.1

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

If upgrading phpMyAdmin is not immediately possible, users can implement the following workaround to mitigate the risk of SQL injection attacks on the user accounts page:

  1. Restrict access to the user accounts page to trusted IP addresses only.
  2. Regularly monitor the user accounts page for any suspicious activity or unauthorized changes.
  3. Implement input validation and parameterized queries to prevent SQL injection attacks.

Here is an example of how to implement input validation in PHP:

$username = $_POST['username'];

// Validate the username
if (!preg_match('/^[a-zA-Z0-9]+$/', $username)) {
    // Handle invalid username
    exit('Invalid username');
}

// Continue with the rest of the code

Please note that this is just an example and the actual implementation may vary depending on the specific application and programming language used.

Conclusion

The CVE-2020-5504 vulnerability in phpMyAdmin exposes users to the risk of SQL injection attacks on the user accounts page. Upgrading to the patched versions of phpMyAdmin and implementing secure coding practices can help mitigate this vulnerability. For further support and assistance in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for phpmyadmin/phpmyadmin →

Share this vulnerability

FAQ

phpMyAdmin is an open-source tool used for managing MySQL databases. It provides a web-based interface for performing various database administration tasks.

SQL injection is a type of vulnerability that allows an attacker to manipulate SQL queries by injecting malicious code. This can lead to unauthorized access to the database and potential data leakage or modification.

The CVE-2020-5504 vulnerability allows an attacker to perform SQL injection attacks on the user accounts page of phpMyAdmin. By injecting custom SQL code, the attacker can bypass authentication and gain unauthorized access to the database.

The CVE-2020-5504 vulnerability is rated as HIGH with a CVSS score of 8.8. This indicates a significant security risk and the potential for exploitation.

To mitigate the risk of the CVE-2020-5504 vulnerability, it is recommended to upgrade phpMyAdmin to version 4.9.4 or later for versions 4.x, and version 5.0.1 or later for versions 5.x. Additionally, implementing input validation and parameterized queries can help prevent SQL injection attacks.

Related vulnerabilities

Recent vulnerabilities recorded for phpmyadmin/phpmyadmin.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • >= 4.0.0, < 4.9.4 4.9.4
    composer require phpmyadmin/phpmyadmin:4.9.4
  • >= 5.0.0, < 5.0.1 5.0.1
    composer require phpmyadmin/phpmyadmin:5.0.1

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback