/

CVE-2026-58422

Severity:

CRITICAL RISK

(9.8)

Improper Authorization (CWE-284) in OAuth Callback Flow

CVE-2026-58422

Deferred

Vulnerability type

Category:

Access Control / Authorization

CWE:

CWE-284

Impact:

Bypass of Administrative Account Disabling and Access Control

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Improper authorization in an application's OAuth sign-in callback logic can silently re-enable accounts that administrators have disabled.

When OAuth responses are trusted without re-checking local account state and permissions, an attacker or user may regain access to a deactivated account simply by completing an external sign-in flow.

Affected context

This vulnerability arises in applications that integrate third-party OAuth identity providers and map successful OAuth logins directly to local user sessions.

It is most relevant where:

  • The application maintains internal account status (active, disabled, banned, etc.).
  • Administrative actions can disable or lock accounts.
  • OAuth callback handlers implicitly trust the identity provider success response and skip or weaken local authorization checks.

Exploit preconditions

  • Attack surface: Public-facing OAuth login endpoints and their callback URLs.
  • Required access: Ability to initiate an OAuth authentication flow for the affected account (e.g., control of the linked identity provider account or session).
  • Trigger point: Receipt of a successful OAuth callback where the application fails to enforce disabled or locked account restrictions before creating a session.
  • Why exploitation is possible: The callback logic treats "externally authenticated" as "locally authorized," omitting or mis-ordering checks for administrative account state and permissions, allowing disabled accounts to be silently reactivated.

Why this happens

The underlying issue is a broken authorization pattern where authentication success is incorrectly equated with permission to access the application.

This maps to CWE-284: Improper Access Control, because the system fails to enforce local account state and authorization rules when handling OAuth callbacks.

Instead of re-verifying that the account is active, permitted, and not administratively disabled, the callback handler automatically issues a valid session or reactivates the account, violating the intended access control policy.

Potential impact

  • Disabled or banned accounts may be silently reactivated and regain access.
  • Users can bypass administrative enforcement actions (e.g., security lockdowns or policy suspensions).
  • Compromised or risky accounts that were intentionally disabled can again access sensitive data.
  • Audit trails and compliance controls can be undermined if account status changes are not visible.
  • Security incident response measures based on disabling accounts may be rendered ineffective.

General mitigation guidance

Effective mitigation focuses on decoupling authentication from authorization and consistently enforcing account state.

Common defensive patterns include:

  • Treating OAuth success only as proof of identity, followed by a strict server-side check of local account status (enabled/disabled/banned) before creating sessions.
  • Implementing a centralized authorization layer that all login and callback flows must consult, rather than duplicating logic in callback handlers.
  • Ensuring administrative disables are represented by explicit, non-bypassable flags that are checked on every login, token refresh, and session creation.
  • Designing sign-in flows so they never automatically change account status (e.g., from disabled to active) based solely on external identity provider responses.
  • Applying least privilege principles to reactivation actions, requiring explicit admin workflows instead of automatic re-enablement.

How teams detect issues like this

Detection typically involves reviewing both code and behavior for authorization gaps in login flows:

  • Static analysis or manual code review of OAuth callback handlers to ensure they call a common authorization and account-state enforcement routine.
  • Verification that any function creating sessions checks account flags (disabled, locked, banned) and does not auto-toggle them based on authentication events.
  • Policy-based tests that attempt OAuth login from disabled accounts to confirm that access is denied and no silent reactivation occurs.
  • Automated tooling or custom linters that flag endpoints which issue sessions without consulting centralized access control logic.
  • Monitoring audit logs for patterns where disabled accounts appear to authenticate successfully without corresponding administrative reactivation events.

Sources

SourceLink
blog.gitea.comblog.gitea.com/release-of-1.26.3-and-1.26.4/
github.comgithub.com/go-gitea/gitea/pull/38009
github.comgithub.com/go-gitea/gitea/releases/tag/v1.26.4
github.comgithub.com/go-gitea/gitea/security/advisories/GHSA-g9g6-qhrc-p3qc

Frequently asked

questions

It can be exploited wherever a disabled account still has a valid or recoverable link to an OAuth identity provider, allowing the user or an attacker controlling that identity to regain access via the sign-in flow.

The exploiter generally needs control over the external identity associated with the disabled account (e.g., the OAuth provider account) or the ability to trigger a successful OAuth authentication that the application maps to that user.

The safest approach is to centralize authorization checks so that every session creation and login—especially OAuth callbacks—verifies local account status and permissions, and refuses to authenticate disabled or locked accounts regardless of external authentication success.

Clearly separate authentication (proving identity) from authorization (granting access), require that all sign-in flows call a shared authorization layer, and test identity federation paths explicitly for adherence to administrative account controls.

Find out what's already
exploitable in your codebase.