Summary
An OAuth2 sign-in flaw can reactivate an account that an administrator previously deactivated when the authentication source does not use refresh tokens. This may allow a person with valid OAuth2 credentials to regain access despite an administrative account-disable action.
Affected context
The issue occurs in authentication flows that support OAuth2 sign-in for external authentication sources without refresh tokens. It becomes risky when an account has been intentionally deactivated by an administrator but the sign-in path treats successful OAuth2 authentication as sufficient to restore or reactivate that account.
Exploit preconditions
- Attack surface: OAuth2-based sign-in and account synchronization
- Required access: Valid credentials or an active identity at the connected OAuth2 provider
- Trigger point: Authentication through an OAuth2 source without refresh-token support
- Relevant state: The corresponding application account has been deactivated by an administrator
- Why exploitation is possible: The sign-in flow does not consistently preserve the administrative deactivation state when processing a successful OAuth2 authentication
Why this happens
The underlying bug is an incomplete authorization-state check in the OAuth2 account lifecycle. A successful external authentication is incorrectly allowed to override or bypass a locally enforced account-deactivation decision when refresh-token handling is unavailable. This maps to CWE-863, Incorrect Authorization, because the application fails to enforce an administrator-imposed access restriction consistently across authentication paths.
Potential impact
- A deactivated user may regain application access
- Administrative account-disable controls may be bypassed
- Unauthorized access to the user's previously available data or functions may occur
- Audit records and account lifecycle policies could become inconsistent
- Accounts with elevated permissions could create greater organizational risk
General mitigation guidance
Mitigation generally focuses on making local account-state enforcement
authoritative across every authentication mechanism.
Common defensive patterns include:
- Treating administrator-deactivated accounts as non-signable-in regardless of external provider status
- Checking local authorization and lifecycle state after OAuth2 authentication succeeds
- Separating identity authentication from account activation or reactivation decisions
- Requiring an explicit, authorized administrative workflow for account reactivation
- Applying the same deactivation policy to OAuth2 flows with and without refresh tokens
- Limiting privileges and session capabilities for accounts whose lifecycle state is uncertain
- Recording and monitoring account-state changes and authentication outcomes
How teams detect issues like this
Detection approaches may include:
- Static analysis and code review for authentication handlers that update account status automatically
- Tests covering deactivated accounts across every OAuth2 provider and token capability
- Review of branches that handle missing refresh tokens or first-time sign-in
- Policy checks requiring local account-state validation after external authentication
- Monitoring for successful sign-ins or session creation immediately following account deactivation
- Automated security review tools that identify inconsistent authorization checks across login paths

