CVE-2020-10804: phpMyAdmin SQL Injection

phpmyadmin/phpmyadmin Updated 02 Oct 2025

Summary

24/05/2022
Yes i
High
8.0

CVE-2020-10804: phpMyAdmin SQL Injection. Affects phpmyadmin/phpmyadmin across 2 version ranges.

>= 4.9.0, < 4.9.5 >= 5.0.0, < 5.0.2

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

Also tracked for

The same CVE-2020-10804 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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

phpMyAdmin is a popular web-based database management tool written in PHP. It provides a user-friendly interface for managing MySQL and MariaDB databases. The vulnerability identified as CVE-2020-10804 affects phpMyAdmin versions 4.x before 4.9.5 and 5.x before 5.0.2. This vulnerability allows an attacker to perform SQL injection attacks by manipulating the current username during the retrieval process. By creating a crafted username, an attacker can trick the victim into performing specific actions with the compromised user account, such as editing privileges.

Vulnerability Detail

The SQL injection vulnerability in phpMyAdmin arises from a flaw in the retrieval of the current username. The affected code can be found in the 'Privileges.php' and 'UserPassword.php' files within the 'Server' and 'User' classes respectively. An attacker with access to the server can exploit this vulnerability by creating a specially crafted username. When the victim interacts with the compromised user account, the attacker can execute arbitrary SQL queries, potentially leading to unauthorized access, data manipulation, or privilege escalation. This vulnerability has a CVSS score of 8.0, indicating a high severity level.

How To Fix

Fixed versions by release line

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

  • >= 4.9.0, < 4.9.5 4.9.5
    composer require phpmyadmin/phpmyadmin:4.9.5
  • >= 5.0.0, < 5.0.2 5.0.2
    composer require phpmyadmin/phpmyadmin:5.0.2

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

Workaround

As a temporary workaround, users can implement input validation and sanitization techniques to prevent SQL injection attacks. It is essential to validate and sanitize user-supplied input before using it in SQL queries. This can be achieved by using prepared statements or parameterized queries, which ensure that user input is treated as data rather than executable code. By implementing these measures, the risk of SQL injection can be significantly reduced.

Conclusion

The SQL injection vulnerability in phpMyAdmin poses a significant risk to the security of database management systems. It is crucial to update phpMyAdmin to the latest version and follow secure coding practices to mitigate the risk of SQL injection attacks. Regularly monitoring for vulnerabilities using tools like Vulert can help ensure the timely identification and remediation of security issues. For further assistance in addressing this vulnerability, please contact DevNack.com.

See every vulnerability recorded for phpmyadmin/phpmyadmin →

Share this vulnerability

FAQ

phpMyAdmin is a web-based database management tool used for managing MySQL and MariaDB databases. It provides a graphical interface for performing various database operations.

The vulnerability affects phpMyAdmin versions 4.x before 4.9.5 and 5.x before 5.0.2.

An attacker can exploit this vulnerability to perform SQL injection attacks, potentially leading to unauthorized access, data manipulation, or privilege escalation.

To fix this vulnerability, update phpMyAdmin to version 4.9.5 or later for 4.x versions, and version 5.0.2 or later for 5.x versions. Follow the official phpMyAdmin website for the latest releases and installation instructions.

As a temporary workaround, implement input validation and sanitization techniques to prevent SQL injection attacks. Use prepared statements or parameterized queries to ensure user input is treated as data rather than executable code.

Related vulnerabilities

Recent vulnerabilities recorded for phpmyadmin/phpmyadmin.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Fixed versions by release line

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

  • >= 4.9.0, < 4.9.5 4.9.5
    composer require phpmyadmin/phpmyadmin:4.9.5
  • >= 5.0.0, < 5.0.2 5.0.2
    composer require phpmyadmin/phpmyadmin:5.0.2

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