Page MenuHomePhabricator

LoginNotify cannot notify for logins from unknown sources if 2FA is enabled
Open, Needs TriagePublic

Description

If a user has 2FA enabled, and someone finds out what their password is and tries to log into their account, they will be stopped at the 2FA step. This means a "successful" login happened from an unknown device, but thanks to 2FA the user was not let in completely.

If I understand the code of LoginNotify correctly, in a situation like this the victim account will *not* be notified because notifications depend on the AuthManagerLoginAuthenticateAudit hook, which is only triggered *after* the 2FA is done. If so, then we might want to use a different hook that would allow notification before 2FA check.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Also 2FA can be retried any number of times (there is throttling, but LoginNotify won't be able to see the separate attempts). I guess the simplest would be to have a SecondFactorAudit hook.

Reedy renamed this task from LoginNotify cannot notify for logins from unkonwn sources if 2FA is enabled to LoginNotify cannot notify for logins from unknown sources if 2FA is enabled.Jan 11 2023, 8:23 PM