Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Filesystem access equals root access #571

Closed
anonymous-piwik-user opened this Issue · 3 comments

3 participants

@anonymous-piwik-user

In addition to being able to login as root password=1234 I can also login using user root password=81dc9bdb52d04dc20036dbd8313ed055

This can have serious consequences if anyone can find a way to print out config/config.ini.php

There may be other situations where an attacker knows the MD5 hash (or other hash should you change digests) but not the password.

@robocoder
Collaborator

What are you proposing be changed?

(I assume by “root”, you meant the Piwik superuser.)

@anonymous-piwik-user

> (I assume by “root”, you meant the Piwik superuser.)

Yes. My config.ini.php file looks like this:

[superuser] login = root password = 81dc9bdb52d04dc20036dbd8313ed055

With these settings, I can log in with username=root, password=1234 as well as username=root, password=81dc9bdb52d04dc20036dbd8313ed055

> What are you proposing be changed?

Don’t compare with the password as listed in the ini-file. Instead, only compare with its hash.

in plugins/Login/Controller.php, replace this:

if(strlen($password) != 32) { $password = md5($password); }

with this:

$password = md5($password);
@mattab
Owner

fixed in 943

- CHANGED previously, it was possible to login using the md5 hash of the password as the password, but for best practises and increased security we removed this feature. - CHANGED previously, it was possible to login using the “one click logme” as described in the <a href=‘http://piwik.org/faq/how-to/#faq_30’>FAQ</a>; we added the rule that this method cannot be used to login as the Super User. - CHANGED slight change in the API of UsersManager.getTokenAuth($userLogin, $md5Password); previously, the second parameter could be either the password or the md5 hash of the password. For increased security and consistency, the second parameter is now required to be the md5 of the password. Please call md5() on the string before calling this API method.

@anonymous-piwik-user anonymous-piwik-user added this to the RobotRock milestone
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.