Skip to content

Login Only mode: deny blocked addresses in onUserAuthorisation as a backstop (without a password oracle) #338

Open

Description

@codeling

Follow-up to item 3 (finding S7) of #285. The documentation part is done in #336: the blocking-mode description now says which logins "Login Only" stops and recommends "Full Site" for sites with third-party logins.

Problem

In "Login Only" mode, RequestClassifier::isLoginAttempt() only recognises:

  • com_users / com_login with the login task (as Joomla's dispatcher runs it),
  • API requests with credentials.

A blocked address can still log in through:

  • com_ajax (core WebAuthn passkeys; harmless for brute force, since passkeys can't be guessed);
  • third-party social or SSO login components;
  • login modules that post to their own controllers.

As long as those extensions call Joomla's authentication, their failed logins are counted (onUserLoginFailure). It's only the block that isn't enforced for them.

Proposed backstop

Deny blocked addresses in onUserAuthorisation by returning Authentication::STATUS_DENIED in the response. That event runs after the password check for every login that goes through $app->login(), whatever the controller.

Caveat (why this isn't done yet): Joomla then shows JLIB_LOGIN_DENIED only after a correct password, and a wrong password gets the normal error. That difference is a password oracle: a blocked attacker could keep guessing and recognise the right password by the message. It must only be done if the answer can be made the same as for a wrong password, for example:

  • handle onUserAuthorisationFailure and replace the message in the queue with the wrong-password message (JGLOBAL_AUTH_INVALID_PASS / whatever the login form shows);
  • make sure the status code, redirect target and timing match a failed password too, including the adaptive delay of Responder;
  • check the API path (ApiApplication answers differently from the site and backend).

Tests needed

  • A blocked address logging in through a non-core controller that calls $app->login() is refused in Login Only mode.
  • The response for a correct and a wrong password from a blocked address can't be told apart (messages, status, redirect).
  • Not blocked: nothing changes.
  • "Full Site" is unaffected (it refuses earlier).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions