Admidio / admidio

Admidio is a free open source user management system for websites of organizations and groups. The system has a flexible role model so that it’s possible to reflect the structure and permissions of your organization.
https://www.admidio.org
GNU General Public License v2.0
336 stars 131 forks source link

Generic Login Error Message #128

Closed ximex closed 8 years ago

ximex commented 9 years ago

We should change the behavior of the printed error messages at the login process.

Today:

Should change to:

We shouldn't give an attacker infos about if a username exists e.g. This way is the common secure way

ximex commented 9 years ago

it looks if this all has to be done in "login_check.php"

Fasse commented 9 years ago

+1 this should be done!

ximex commented 9 years ago

also change the case insensive username checking to a case sensitive check. WHERE UPPER(usr_login_name) LIKE UPPER(\''.$loginname.'\') to WHERE usr_login_name LIKE \''.$loginname.'\'

ximex commented 9 years ago

And PLEASE use Joins!!! the code looks like as it really needs a rewrite ;-)

sistlind commented 9 years ago

I think usernames should not case sensitive, there is not much security improvement, but it can be complicated, if there are several users differing only in case. Often people using their email and this is also not case-sensitive.

Perhaps the better way is to allow only lowercase usernames at all.

Fasse commented 9 years ago

The username should not be case sensitiv. This is easier for users to register.

ximex commented 9 years ago

The username should not be case sensitiv.

ok

Fasse commented 9 years ago

@ximex do you implement this?

ximex commented 9 years ago

if i found time for this yes. shouldn't be that hard

Fasse commented 9 years ago

The release of 3.1 is "far" away ;)

ximex commented 9 years ago

first part done: https://github.com/Admidio/admidio/commit/bd85d3cbfc93f88b98f604979f877bc64a561058

Edit: Updated commit id

ximex commented 9 years ago

Flow should be:

  1. check input (not empty)
  2. find user
  3. check password
  4. check if activated
ximex commented 8 years ago

ok we have to look at other things too: is the user currently a member of valid role? What should we do if:

I think "Login incorrect (username OR password)" is wrong in all 3 possibilities

If "username & password correct & NOT activated" with any state of the membership or role status above should always the message "not activated"

so the new flow:

  1. check input (not empty)
  2. find user
  3. check if max false passwords <= 3
  4. check password
  5. check if activated
  6. check membership/role state

So we need the messages for the 3 possibilities above to set the behaviour of Point 5.

Edit: change flow (add check for 3 false passwords)

ximex commented 8 years ago

I'm nearly finished with the code. Now i have to change the code for the update login. The other things work. I used "Anmeldedaten korrekt, jedoch ist dieser User aktuell kein gültiges Mitglied einer Organisation." for all 3 possibilities from the last message.

ximex commented 8 years ago

@Fasse please check

One more message added for "no webadmin"

Fasse commented 8 years ago

looks good to me, some basic checks were ok. only changed some messages.