Page MenuHomePhabricator

Tie reauthentication (login with elevated security) to a specific security level
Open, MediumPublic

Description

Currently when a user logs in (or reauthenticates) the login timestamp gets stored and elevated security checks just verify that that timestamp was less than $wgReauthenticateTime seconds ago. This is somewhat insecure - an attacker can wait for the user to do something mildly sensitive, then take over the account and use it for something very sensitive. It would be better if every different action type (security level) would require separate reauthentication.

This would require exposing the security level of the ongoing reauthentication to the auth framework, which is a good thing in general (as it would go a long way towards T197153: Make some providers optional for reauthentication).

See also: T420672: Implement separate reauthentication state for different actions

Details

Related Changes in Gerrit:

Event Timeline

Change 471664 had a related patch set uploaded (by Gergő Tisza; owner: Gergő Tisza):
[mediawiki/core@master] [WIP] AuthManager: Modify security level handling

https://gerrit.wikimedia.org/r/471664

chasemp triaged this task as Medium priority.Dec 9 2019, 4:42 PM

This is somewhat insecure - an attacker can wait for the user to do something mildly sensitive, then take over the account and use it for something very sensitive.

The threat is probably more like the attacker forces a logout action and waits for the user to log back in (or for people who dont check remember me, just waits)

Yeah that's T207557: Don't count initial login as valid for any operation that requires reauth. We should definitely fix that one; other than having to be cautious about SUL3, it seems straightforward.

Separate reauth for each operation is something I'm less sure about. It would work fine as long as "operation" means special page name, but for more complex things (e.g. requiring reauth for a certain set of permissions, and then "operation" would be the permission name, and you might need multiple permissions for some actions" it might get messy, plus we'd need to keep track of what operations are allowed in the current session.

Change #471664 abandoned by Hashar:

[mediawiki/core@master] AuthManager: Modify security level handling

https://gerrit.wikimedia.org/r/471664

Change #471664 restored by Thcipriani:

[mediawiki/core@master] AuthManager: Modify security level handling

https://gerrit.wikimedia.org/r/471664