Problem: there is no flood control allowing an attacker to brute force user/password combinations. Take a look at user_login_authenticate_validate() and user_login_final_validate() in Drupal core to see how the flood protection should work.

Comments

skwashd’s picture

Assigned: Unassigned » skwashd
skwashd’s picture

Assigned: skwashd » Unassigned
Status: Active » Needs review
StatusFileSize
new1.6 KB

@klausi are you ok with the attached patch?

klausi’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

jribeiro’s picture

Looks good here too. The user is blocked by flood control when try to make 5 requests with wrong access data.

+1 RTBC

markpavlitski’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new1.86 KB

I noticed a couple of things about the patch in #2: it registers 'failed_login_attempt_user' events but doesn't check for them with flood_is_allowed(), and doesn't clear flood failures on successful login.

The attached patch leans on the validation that the user_login form uses instead, so it registers and checks the same events.

It seems like services doesn't respond well to drupal_access_denied() - it prints the themed Drupal 403 page which screws with the json/xml/whatever response. Not authenticating the user seems to be enough to present a standard services access denied message in the correct format.

(no interdiff as the approach is too different).

klausi’s picture

Status: Needs review » Reviewed & tested by the community

Cool, even better.

  • skwashd committed 46b1018 on 7.x-1.x authored by markpavlitski
    Issue #2433019 by skwashd, markpavlitski: Add user login flood control
    
skwashd’s picture

Status: Reviewed & tested by the community » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.