Support

Admin Tools

#9899 Master Password is stored as Open text

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by nicholas on Thursday, 16 June 2011 07:13 CDT

user33181
Mandatory information about my setup:

Have I searched the forum before posting? Yes
Have I read the Troubleshooting Wizard before posting? Yes
Have I read the documentation before posting? Yes
Joomla! version: 1.5.22
PHP version: (unknown)
MySQL version: (unknown)
Host: (optional, but it helps us help you)
Admin Tools Professional version: 2.0.5


Description of my issue:

I have just found out, that Master Password is stored as open text as parameter "masterpassword" of component "COM_ADMINTOOLS" in table "akb_components". I would expect that ADMIN TOOLS pays attention to security and stores ALL passwords in irreversible form (i.e. hash).
My question is if any other passwords are stored elsewhere as open text, too. I also require security update of ADMIN TOOLS PRO to secure all passwords in irreversible form.

Thank you,

nicholas
Akeeba Staff
Manager
You made a wrong assumption, that the Master Password feature is a security or authentication feature. It is not. First, let me explain why it is NOT either of them.

In order to come to a point where you need the MP you have to log in to the back-end of the site as a Super Administrator. If you do that and your objective is to disable Admin Tools, you can just as easily go to the Plugin Manager, disable "System - Admin Tools", then go to the Extensions Installer and uninstall Admin Tools. Game over. Protection has gone away. Dumping the database to steal the MP is an unnecessary overkill. Corollary: your most valuable asset is applying Admin Tools' security features to prevent a malicious user from logging in as a Super Administrator in the back-end of your site.

So, what is the MP good for if it's not a security or authentication feature? It's there to keep nosy clients from wrecking havoc on the site you delivered to them. Most usually, we set up a site with the exact .htaccess and WAF configuration required. We don't want the client to go around and play with those settings, due to the unfortunate consequences of such an endeavour. This is where MP comes to play.

Another question is how you can limit who can access Admin Tools? Well, it's called ACL :) In Joomla! 1.6 we use Joomla!'s built-in ACL system. Just click on the "Options" button in the toolbar. In Joomla! 1.5 we have our own ACL system which can be managed by clicking on the "Access Control" button. You can then choose which user has which privileges. Simple and easy.

Regarding your other question, Admin Tools does not store any passwords except the MP. Regarding our other software, Akeeba Backup does store passwords in their original form because they have to be used to authenticate the site against external services, e.g. database servers, FTP servers, Amazon S3, etc. That said, if your server supports mcrypt, Akeeba Backup will use it to encrypt its data with a randomized password created the first time you run the component and stored in a PHP file so that it can not be directly accessed over the web.

It's no my turn to demand you to think the context of the MP and understand why it is not being stored encrypted. Storing it encrypted would require a separate view to set the MP and a separate view to manage the restricted views. This is an overkill considering the context of its use so I decided to favour usability against unnecessary security.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user33181
Hi,

I have taken a look at the source code and I have found out following there:

1. Authentication procedure (comparing MP stored in DB with MP inserted by user):

$masterHash = $params->get('masterpassword','');
...
$masterHash = md5($masterHash);
...
$userHash = $session->get('userpwhash', '', 'admintools');
return ($masterHash == $userHash);

2. Setting new MP:

$params->set('masterpassword', $masterPassword);

I think that the code above could be replaced by following code:

1. Authentication procedure (comparing MP stored in DB with MP inserted by user):

$masterHash = $params->get('masterpassword','');
...
//$masterHash = md5($masterHash);
...
$userHash = $session->get('userpwhash', '', 'admintools');
return ($masterHash == $userHash);

2. Setting new MP:

$params->set('masterpassword', md5($masterPassword));

The only difference is that in replaced procedures, we store hash of the MP in the DB, not MP as open text. And that is my goal, because I do think that no passwords should be ever stored in open form, whichever the purpose which they are used for is. The problem might occur if the same passwords would be used for different purposes - in such case they could be easily guessed by attacker.

Do you see any consequencies which could result from updating the procedures above? Maybe not only from Akeeba ADMIN TOOLS but also from Akeeba BACKUP point of view ...
This is the "security patch" which I have asked for in my last email.

Thank you,

nicholas
Akeeba Staff
Manager
The software is licensed under the GPL so that you are able to modify it. You can study, understand and modify the code. I won't help you with that because code customisation is not included in the support services we provide. We also won't provide support for modified versions of our software. We only provide support for using unmodified versions of our software. If you want to exercise the freedoms granted to you by the GPL you are free to do that, but now you're creating a derivative work which is no longer supported by us.

Side note: if you think that what you're doing is secure, just Google the term "rainbow tables". Or, if you're a little lazy, take a look at this page. Using plain MD5 is just as good as using no encryption at all. Given the MD5 you can very easily come up with an equivalent password from the rainbow table. In order to mitigate RT attacks you need to salt the password before hashing it. Take a look at how Joomla! is doing it since 1.0.11.

Regarding Akeeba Backup, as I said, we encrypt your entire configuration with AES-128 if your server has mcrypt installed. If not, the passwords are stored in cleartext. IMHO, if your server doesn't support mcrypt it's a crappy box anyway, so it's best to dump it and choose a decent host.Back to your question, if you produce MD5 of the passwords which Akeeba Backup needs... well, just try it and you'll see hell breaking loose. The thing is, all passwords stored are not being used to authenticate a user against Akeeba Backup. They are being used to authenticate Akeeba Backup against a remote server. IMPORTANT: we DO NOT have any saying as to how the remote server works!

So, Akeeba Backup needs to have access to the original password, not an irreversible MD5 sum or other hash. Example to help you think about it: if I asked you to give me your FTP credentials and you gave me the MD5 of your password, would I be able to login to your FTP server? No way I could. Likewise, if Akeeba Backup was storing the MD5 hash of your FTP password, would it be able to log in to the remote FTP server and upload the backup archives? Nope. MD5 sums are one-way hash functions. That's why we're using the industry-standard bidirectional AES-128 encryption algorithm in CBC mode to encrypt the configuration data whenever possible.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

slaes
and even when salted can be broken with the multitude of rainbow table resources available. Lesson - make your password long, minimum 16 char.

Niko, your a man of all things non obscure :) we all love it.

On another note, during my own penetration testing, i have harvested a list of over 50+ Joomla sites with user name admin and password, you guessed it admin. 95% of which are website dev companies, shame on them.

Im itching to publish this here, however i fear you wont be too impressed, lol :)

nicholas
Akeeba Staff
Manager
Many times I ask for SA access on users' sites to fix problems they have with my software which require hands-on access. If I had a fiver every time the username was admin or the password was something trivially guessable I would now be typing on a keyboard whose frame is made of gold and keys made of diamonds :)

As an interesting side note, do you know what is better than a 16 character password? Choosing four random, unrelated words and combining them. For example, "Cockroach Entrenchment Napkin Austerity" would take a few thousand years for a modern supercomputer to crack by brute force. Skew the spelling a bit and throw some special characters and numbers in there to make it unsusceptible to dictionary attacks and you're set. Not bad, huh?

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user33181
Thanks guys for your explanation. I really had to try to use my MD5 procedures to store hash of MP in DB, not the clear text. Admin Tools were OK with this modifications, however Akeeba Backup stopped working - Backup procedure could not be initialized. I suppose that Akeeba Backup could not authenticate itself against the server (as the hash may be provided to it instead of the clear text pwd). But my question is: how the Akeeba Backup is connected with Master Password in Admin Tools? I thought they are separate 2 products. And if Backup does use MP, then what if no MP is set in Admin Tools. BTW, how MP can be connected anyhow with authentication against servers?

Could you please provide me an explanation of this process?

Thank you,

nicholas
Akeeba Staff
Manager
Akeeba Backup has nothing to do with Admin Tools and the Master Password feature of the latter. Akeeba Backup doesn't need to "authenticate" itself against the server. It merely checks if you have adequate rights to perform a backup. And, as I explained, the Master Password does not authenticate anyone to anything. It's a small hurdle, not an authentication procedure. Authentication means a method for proving your identity to an authority. MP does not prove your identity by any means (your username/password pair in Joomla! does). It's a complementary method to authentication, making sure that someone doesn't accidentally use a feature which could kill his site.

Regarding your Akeeba Backup problem, first make sure that you have not modified any of its files. Perform a clean installation of Akeeba Backup if you are not sure. Then, retry backup. If it still fails, please start a new thread and post your Akeeba Backup log file.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!