CVE-2017-18264: phpMyAdmin Improper Privilege Management
Summary
CVE-2017-18264: phpMyAdmin Improper Privilege Management. Affects phpmyadmin/phpmyadmin across 4 version ranges.
>= 4.0, < 4.0.10.20
>= 4.4.0, <= 4.4.15.10
>= 4.6.0, <= 4.6.6
>= 4.7.0-beta1, < 4.7.0
Fixed in 4.0.10.20 or 4.7.0, depending on the release line you run. How to fix ↓
Also tracked for
- phpmyadmin · Debian:11
The same CVE-2017-18264 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
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.
No signup required · Results in about 60 seconds
Background
phpMyAdmin is a popular open-source administration tool for managing MySQL databases. It provides a web-based interface that allows users to perform various database management tasks such as creating, modifying, and deleting databases, tables, and queries. The vulnerability in question affects phpMyAdmin versions 4.0 before 4.0.10.20, 4.4.x, 4.6.x, and 4.7.0 prereleases. This vulnerability relates to improper privilege management, which can lead to unauthorized access to the application by users who have no password set, even if the administrator has explicitly disallowed such access.
Vulnerability Detail
The vulnerability arises due to a bypass of the restrictions imposed by the configuration option $cfg['Servers'][$i]['AllowNoPassword'] = false. Under certain PHP versions (e.g., version 5), the restrictions can be circumvented, allowing users without a password to log in, even if the administrator has explicitly disabled this behavior. The issue stems from the fact that some implementations of the PHP substr function return false when given an empty string ('') as the first argument. This can be exploited to bypass the password check and gain unauthorized access to the phpMyAdmin application.
How To Fix
Fixed versions by release line
The minimum fixed version depends on the release line you run.
-
>= 4.0, < 4.0.10.204.0.10.20composer require phpmyadmin/phpmyadmin:4.0.10.20 -
>= 4.7.0-beta1, < 4.7.04.7.0composer require phpmyadmin/phpmyadmin:4.7.0
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 to a fixed version is not immediately feasible, a temporary workaround can be implemented by modifying the affected code. Specifically, the substr function call in the libraries/common.inc.php file needs to be replaced with a different implementation that does not exhibit the bypass behavior. Here is an example of how the code can be modified:
// Original code
if (substr($password, 0, 0) === '') {
// Bypass password check
}
// Modified code
if (empty($password)) {
// Perform alternative password check
}
By making this change, the vulnerability can be mitigated until a proper upgrade can be performed.
Conclusion
The vulnerability in phpMyAdmin allows users without a password to bypass the login restrictions, potentially leading to unauthorized access to the application and the underlying database. It is crucial to upgrade to a fixed version of phpMyAdmin to mitigate this vulnerability. If immediate upgrading is not possible, implementing the provided workaround can provide temporary relief. For further assistance and support in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for phpmyadmin/phpmyadmin →
FAQ
phpMyAdmin is an open-source administration tool for managing MySQL databases. It provides a web-based interface for performing various database management tasks.
The vulnerability affects phpMyAdmin versions 4.0 before 4.0.10.20, 4.4.x, 4.6.x, and 4.7.0 prereleases.
The vulnerability allows users without a password to log in to the phpMyAdmin application, even if the administrator has explicitly disallowed such access. This can lead to unauthorized access to the database and potential data breaches.
To fix this vulnerability, it is recommended to upgrade to a fixed version of phpMyAdmin. The vulnerability has been addressed in versions 4.0.10.20, 4.7.0, 4.4.15.10, and 4.6.6.
Yes, a temporary workaround can be implemented by modifying the affected code. Details of the workaround can be found in the 'workaround' section of this report.
Related vulnerabilities
Recent vulnerabilities recorded for phpmyadmin/phpmyadmin.