phpMyAdmin security vulnerability

fln

Administrator
Staff member
Joined
Aug 30, 2021
Messages
1,516
With the latest DA release, a security vulnerability for phpMyAdmin installation was fixed. More details are recently added to the change log.

The issue is fixed in all active release channels (alpha, current, stable) and additionally in the rhel7 and debian10 EOL release channels. If DA auto-updates were not disabled, there are no additional actions needed to secure the server.

The file examples/signon.php is just a simple login-form, but it allows specifying the database server address. We received a report that on one server the ability to connect to an arbitrary MySQL server was converted to an exploit that gets file read access for the webapps user. Since webapps is used for Roundcube, file read access for webapps can be used to read Roundcube session data and extract IMAP credentials.

The PHP configuration with mysqli.allow_local_infile = Off is not enough because phpMyAdmin explicitly enables it, when user is visiting import page. The phpMyAdmin attempted to fix it with PMASA-2019-1 but latest phpMyAdmin versions are still vulnerable with no server side option to disable it.

Please check if the servers you manage show any signs of this vulnerability being exploited:

Code:
grep 'POST.*/examples/signon.php.* 302 ' /var/log/*/domains/*.log /var/log/*/access_log*

If you spot any suspicious activity, please rotate the Roundcube database credentials and encryption key with the following commands:

Code:
rm /var/www/tmp/sess*
sed -i -e '/db_dsnw/d;/des_key/d' /var/www/html/roundcube/../config/config.inc.php  # remove DB credentials and encryption key to force CustomBuild to generate new ones
da build roundcube                                                                  # reinstall roundcube, to generate new config
mysql --defaults-extra-file=<(da my-cnf) -e "DELETE FROM da_roundcube.session"      # remove old roundcube sessions, that used the old encryption key

And rotate email account passwords.
 
Were servers with phpmyadmin_public no also vulnerable?
Yes, the script in examples directory is like an additional login page that was accessible even if we block the access from main login page.
 
Yes, if the examples directory is present on the server the phpMyAdmin installation is vulnerable. Even if SSO integration from DirectAdmin UI into the phpMyAdmin is not used, the external authentication mechanism is active and example scripts could be used as an alternative login page.
 
Hmm, what if we do not see the update? Of course my OS is EOL

Update: Maybe the fix removed the examples directory?
 
Last edited:
Just to be 100% sure:

Did the initial release of the current stable/current already have the fix included or did it get fixed later via an hotfix update? (And if so what are the SHA of them?)
I have updated my server right when stable got bumped to 1.713 but have not received any emails after that about updates being installed, (So no updates after that and the updates page does not not report a newer version.)
 
That means it'd better to have different identity for RoundCube and phpMyAdmin
( e.g. webapps1 for roundcube , webapps2 for phpMyAdmin , ... )
 
  • Like
Reactions: fln
Back
Top