Closed (fixed)
Project:
Login Security
Version:
2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
23 Apr 2019 at 06:26 UTC
Updated:
17 Jan 2023 at 12:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
dkolarevic commentedMaybe the solution is to check if the user exists.
Comment #3
rajdeep0826 commentedComment #4
rajdeep0826 commentedUpdate the patch with message
Comment #5
jaydub commentedComment #6
anybody@rajdeep0826 could you please reroll this against 2.x?
Comment #9
rpayanmComment #10
anybodyComment #11
anybodyI commented the MR. This still needs work, but the proposed changes are reducing security, so that's not a good thing.
Comment #12
anybodyAnd we should have a test for a non-existent user login try.
The expected result would be that trying to log in as a non-existent user is counted as a wrong login attempt, as it's a possible attack. But the message shown should be correct, of course.
Behind the scenes, it should be handled like a failed login attempt.
@Grevil could you add such a test and have a look at my comments in the MR?
Comment #13
anybodyComment #14
anybodyComment #16
grevil commentedUnfortunately, this is not easily done, but I am on it.
After every login validation, the module checks which attempt settings are activated (soft host, hard host, user), compares the set values with the appropriate login count value (ip_current_count, user_current_count) and blocks them if necessary. Both count attributes are being fetched from the same database "login_security_track", which is created by this module.
Basically, it counts every table rows "host" / "name" entry based on the attempt setting.
Before, these database entries were only created if the typed in user really exists, I fixed this problem, by adding every login attempt to the database table. I hope this won't lead to errors on websites with huge traffic.
Furthermore, I am unsure if this concept really is the best approach... Drupal core's flood control should already have a logging table like this, we should discuss this in #3330627: [META] Improve behaviour with the user module's flood control.
Comment #17
grevil commentedFYI, a bunch of tests fail by my changes. For once, the hard blocking still doesn't work and the other tests need further investigation.
Comment #18
grevil commentedAll done! Please review.
Comment #19
anybodyCode is fine! Once the tests go green, feel free to merge this.
Comment #20
anybodyComment #21
grevil commentedAll tests are green! Merging!