Page MenuHomePhabricator

The CentralAuth token obtained from an elevated-security session should itself be elevated
Open, Needs TriagePublic

Description

Now that we have better handling for reauthentication, and now that we've already made it global-ish on wiki farms (change 1285894), I think the correct solution here would be for centralauthtoken-based sessions to "inherit" the elevated login state from the session which generated the token.

Since rMW5a7ce09d3a07: Move allowSecuritySensitiveOperationIfCannotReauthenticate to SessionProvider, providers can decide how to handle security-sensitive operations if reauthentication is not an option. CentralAuthTokenSessionProvider should inherit the elevation flags from the session from which it was created, and decide based on that.

Event Timeline

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

Maybe we should replace SessionProvider::allowSecuritySensitiveOperationIfCannotReauthenticate() with just SessionProvider::allowSecuritySensitiveOperation( $operation, $session ) where the AuthManager:lastAuthTimestamps session data array is just the default SessionProvider implementation (that would also make T430028: Use central session for reauthentications straightforward), and expose something like Session::getAllowedOperations() returning an operation name => expiry map that can be copied either into the CA token itself (which has recently been changed to a JWT) or the token store data, in CentralAuthApiTokenManager::getToken()