Skip to content
Snippets Groups Projects
  • Jared Hancock's avatar
    login: Require CSRF token to login · 504831fe
    Jared Hancock authored
    This patch fixes a vulnerable scenario, where sequential login attempts can
    be made without an existing session, and without a valid CSRF token. This
    scenario lends itself well for brute force password attempts, because
    attackers can avoid using a session and still send requests to determine if
    a set of credentials are valid. This vector also avoids the authentication
    lockout mechanism, because it requires an ongoing session to shutdown the
    requests.
    
    This patch addresses the issue by requiring a session and a valid CSRF token
    generated by the server and placed in the session to be submitted with the
    credentials. Therefore, an existing session and a Cookie header are required
    to process a login attempt. Secondly, the CSRF token will be changed on the
    server after each login processed. Therefore, for each session, a subsequent
    GET request would be necessary before submitting another login attempt.
    504831fe