Skip to main content

Gitea EUVDEUVD-2026-58141

| CVE-2026-55987 HIGH
Incorrect Authorization (CWE-863)
2026-07-21 https://github.com/go-gitea/gitea GHSA-vrhc-jjfc-m3m3
High
Disputed · 8.1 Vendor: https://github.com/go-gitea/gitea
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Admin deactivates user via Activated toggle
  2. Delivery
    Deactivated user initiates Sign in with GitHub
  3. Exploit
    Complete upstream OAuth2/OIDC provider flow
  4. Execution
    Callback reads empty stored refresh token
  5. Persist
    Gate mis-classifies as cron-disabled, sets IsActive=true
  6. Impact
    Full session granted, prior access (incl. admin) regained

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V8 - Authorization Authorization logic validation
MITRE ATT&CK

1 technique across 1 tactic: Privilege Escalation

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires all of: (1) the Gitea instance uses an OAuth2 authentication source that does not issue refresh tokens - a GitHub auth source, or an OIDC/OAuth2 source configured without offline_access; (2) the target account was previously linked and has signed in at least once, so an external_login_user row with an empty refresh_token already exists; (3) the account was disabled specifically via the 'Activated' toggle (is_active=false), not via 'Prohibit Login'; and (4) the attacker controls that account's credentials at the upstream provider and can complete the provider login. Limiting factors: accounts blocked with 'Prohibit Login' remain blocked; sources that issue refresh tokens (OIDC with offline_access) are not affected because the deactivated user's stored refresh token is non-empty; and the attacker must be the deactivated user themselves, so this is self-reactivation rather than takeover of arbitrary accounts.

Impact

The CVSS 3.1 vector CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N (base 8.1, High) is consistent with the described attack: network-reachable login flow, low complexity, and low privileges (the attacker must be the specific deactivated user with valid provider credentials, not an anonymous outsider). No EPSS score was provided in the input, so probabilistic exploitation likelihood cannot be quantified here. The vulnerability is not in CISA KEV and there is no evidence of active exploitation; however, a step-by-step reproducible PoC is published in the GitHub Security Advisory, lowering the practical barrier to abuse. Realistically this is a meaningful priority for organizations that use the 'Activated' toggle as an offboarding/lockout mechanism on GitHub or non-offline_access OIDC auth sources, precisely because it defeats a control administrators believe is effective and can silently restore admin access. It is lower priority for instances that instead use 'Prohibit Login' (unaffected) or that do not deactivate accounts. The main limiting factor is that the attacker must already possess the deactivated account's upstream provider login, so this is account self-restoration rather than mass unauthenticated compromise.

Exploit ScenarioDerived

An administrator offboards a user (or a rogue admin) by unchecking 'Activated,' trusting that the account can no longer log in. Following the published PoC, the deactivated user simply clicks 'Sign in with GitHub' and completes the normal provider flow; Gitea's callback sees the empty refresh token, flips is_active back to true, and issues a working session - restoring all prior access, including admin if the account had it. The attack requires only the user's own upstream GitHub/OIDC credentials and low complexity (AV:N/AC:L/PR:L).

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 21, 2026

Improper authorization in Gitea before 1.27.0 lets an administrator-deactivated user (IsActive=false) silently reactivate their own account by signing in through an OAuth2/OIDC source that issues no refresh token - notably GitHub, or any OIDC source without offline_access. The reactivation gate added in PR #38009 uses an empty stored refresh token as its signal for 'disabled by auto-sync cron,' but for these sources every user has an empty refresh token, so an administrator's deliberate deactivation is indistinguishable from a cron disable and gets undone on the next login, granting a full session (including regained admin rights, since deactivation does not clear IsAdmin). No public exploit code is packaged, but a detailed, reproducible proof-of-concept is published in the vendor advisory; not listed in CISA KEV.

RemediationAI

Vendor-released patch: upgrade to Gitea 1.27.0 or later, which corrects the reactivation gate so an empty refresh token no longer counts as proof of a cron-initiated disable (advisory: https://github.com/go-gitea/gitea/security/advisories/GHSA-vrhc-jjfc-m3m3; release: https://github.com/go-gitea/gitea/releases/tag/v1.27.0). If you cannot upgrade immediately, use 'Prohibit Login' instead of (or in addition to) the 'Activated' toggle to lock out an account, since ProhibitLogin is enforced separately and is not bypassed by this flaw - the trade-off is that Prohibit Login is a harder ban that is less convenient for temporary suspensions. As an additional stopgap for high-risk accounts, disabling or removing the affected user's external_login_user linkage or temporarily disabling the GitHub/no-refresh-token authentication source prevents the OAuth2 callback path from reactivating them, at the cost of blocking legitimate logins through that source. Because deactivation does not clear IsAdmin, also review and strip admin rights from any account you intend to keep disabled.

Affected VersionsENISA

Gitea Open Source Git Server 0 ≤1.26.4

Affected Packages

go code.gitea.io/gitea fix: 1.27.0
go gitea.dev fix: 1.27.0
euvd gitea_open_source_git_server no fix

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 3 packages in go, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The flaw lives in Gitea's OAuth2 sign-in callback handler handleOAuth2SignIn in routers/web/auth/oauth.go. When a returning user is inactive, the code fetches the external_login_user row and computes isDisabledByAutoSync = hasExt && extLogin.RefreshToken == "", reactivating the account when true. The root-cause class is CWE-863 (Incorrect Authorization): the authorization decision relies on a state signal (empty refresh token) that does not actually mean what the code assumes. Three implementation facts make the signal meaningless for refresh-tokenless providers: the auto-sync cron in services/auth/source/oauth2/source_sync.go returns early when provider.RefreshTokenAvailable() is false and therefore never disables such users; services/externalaccount/user.go stores exactly what the provider returned (RefreshToken: gothUser.RefreshToken), so no token is synthesized; and goth's GitHub provider hardcodes RefreshTokenAvailable() to return false. The affected package is the Go module code.gitea.io/gitea (CPE pkg:go/code.gitea.io_gitea).

Know when Gitea gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Sources disagree (Low–High)
Vendor (https://github.com/go-gitea/gitea) PRIMARY 8.1 HIGH
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
vuln.today AI 8.1 HIGH

Attacker must control the deactivated user's provider login (PR:L), exploit is a low-complexity network login flow (AV:N/AC:L), reactivation alters authZ state and grants full account access (C:H/I:H), with no availability impact (A:N).

3.1 AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
4.0 AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N
SUSE HIGH
Red Hat 3.5 LOW

vuln.today treats the vendor’s rating as authoritative. A higher third-party CVSS (e.g. CISA-ADP) is shown for transparency but does not drive the headline severity.

CVSS VectorVendor: https://github.com/go-gitea/gitea

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None

DescriptionCVE.org

Description

Gitea's OAuth2 sign-in callback reactivates a deactivated user account (IsActive=false) when the user signs in through an authentication source that does not issue refresh tokens (notably GitHub, and any OIDC/OAuth2 source configured without offline_access). PR #38009 added a gate intended to reactivate users only when the OAuth2 auto-sync cron had disabled them, using "the stored refresh token is empty" as the signal. That signal is wrong: for sources that never issue refresh tokens, an empty refresh token is the normal state of every user, so the gate cannot distinguish a cron-disabled account from one an administrator deliberately deactivated. The next time the administrator-deactivated user signs in through the provider, Gitea sets IsActive=true and grants a full session, silently undoing the administrator's action. This is the exact behavior #38009 was written to prevent. (ProhibitLogin, the hard ban, is enforced separately and is not affected.)

No special privileges are required beyond being the deactivated user and being able to sign in through the source.

Root Cause

routers/web/auth/oauth.go (the handleOAuth2SignIn reactivation gate):

go
if !u.IsActive {
    extLogin, hasExt, err := user_model.GetExternalLogin(ctx, authSource.ID, gothUser.UserID)
    if err != nil { ctx.ServerError("GetExternalLogin", err); return }
    isDisabledByAutoSync := hasExt && extLogin.RefreshToken == ""   // wrong signal
    if isDisabledByAutoSync {
        opts.IsActive = optional.Some(true)                          // reactivates the account
    }
}

The assumption that RefreshToken == "" is produced only by the auto-sync cron is false:

  • The cron's disable path is unreachable for sources without refresh tokens. services/auth/source/oauth2/source_sync.go returns early: if !provider.RefreshTokenAvailable() { return ... }, so it never disables (or touches the tokens of) such users.
  • The stored token is exactly what the provider returned, with no synthesizing: services/externalaccount/user.go stores RefreshToken: gothUser.RefreshToken. When the provider issues none, this is "" from the first login.
  • GitHub never issues a refresh token: goth hardcodes func (p *Provider) RefreshTokenAvailable() bool { return false } (providers/github/github.go). OIDC/OAuth2 without offline_access likewise store "".

So for a GitHub (or no-refresh-token) source, RefreshToken == "" is the state of every user, including one an administrator deactivated, and the gate reactivates them.

Proof of Concept

Setup:

  • A Gitea instance with a GitHub authentication source (Admin Panel -> Authentication Sources -> OAuth2 -> GitHub), or any OAuth2/OIDC source configured without offline_access.
  • Account V: a normal user who has signed in at least once through that source (an external_login_user row exists with empty refresh_token).

Steps:

  1. As an administrator, open Admin Panel -> Users -> V and uncheck "Activated" (is_active=false). Confirm V's requests now bounce to the activation page.
  2. As V, sign in again via "Sign in with GitHub" and complete the provider flow.
  3. V lands in the application with a working session. SELECT is_active FROM "user" WHERE lower_name='v'; now returns true.

Expected (intended by #38009): V stays is_active=false and is routed to the activation page. Actual: V is is_active=true with a full session - the administrator's deactivation is undone.

- GitHub user, ADMIN deactivated                 refreshToken=""    -> REACTIVATED + session granted   <<< admin action undone
- OIDC user w/ refresh token, ADMIN deactivated  refreshToken="..." -> stays disabled  (control)
- OIDC user, AUTO-SYNC cron disabled             refreshToken=""    -> REACTIVATED (intended)
RESULT: BYPASS CONFIRMED.

Gitea's own regression test TestOAuth2CallbackReactivationGating ("auto-sync-disabled user is reactivated") sets RefreshToken="" and asserts reactivation after a full OIDC callback - that state is identical to a GitHub-source user an administrator deactivated.

Impact

Any Gitea instance using a GitHub authentication source (one of the most common) or an OIDC/OAuth2 source without refresh tokens, that relies on the "Activated" toggle to disable accounts, is affected. A deactivated user restores their own account to active and obtains a session, regaining whatever access the account had. Deactivation does not clear IsAdmin, so a deactivated administrator regains admin access. Bound: accounts disabled with "Prohibit Login" stay blocked; this defeats the IsActive=false deactivation only.

Executive ViewAI

Why It Matters

Any organization using Gitea for source code management faces a critical access control risk: deliberately deactivated administrators can silently reactivate their accounts and regain full administrative access by logging in through OAuth providers such as GitHub. No vendor patch is currently available, and publicly available exploit code exists in the vendor advisory.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: disable OAuth/OIDC login providers and enforce local authentication only; implement manual administrative approval for any login from deactivated accounts; delete deactivated admin accounts instead of deactivating them; enable comprehensive logging and monitoring of all logins from deactivated accounts via SIEM or security monitoring tools.

Threat Intelligence Overview

EPSS Score
0.2%
Top 95% exploitable
Prevalence
High
one of the most widely deployed self-hosted Git servers
Threat Intel
1
1 source
Data Quality
6 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact
High

Priority Score

40
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +40
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.

More in Gitea

View all
CVE-2026-60004 CRITICAL POC
9.8

Remote code execution in Gitea (self-hosted Git service) via a code-injection flaw (CWE-94) allows attackers to run arbi

CVE-2026-27771 HIGH POC
8.2 Jul 03

Broken access control in Gitea's Composer package registry (versions up to and including 1.26.1) lets remote attackers r

CVE-2022-30781 HIGH POC
7.5 May 16

Gitea before 1.16.7 does not escape git fetch remote. Rated high severity (CVSS 7.5), this vulnerability is remotely exp

CVE-2020-14144 HIGH POC
7.2 Oct 16

The git hook feature in Gitea 1.1.0 through 1.12.5 might allow for authenticated remote code execution in customer envir

CVE-2024-6886 CRITICAL POC
10.0 Aug 06

Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') vulnerability in Gitea Gitea

CVE-2026-72867 CRITICAL POC
9.9 Aug 10

Authenticated command injection in Dokploy (self-hostable PaaS) versions 0.29.3 through 0.29.12 lets a low-privileged us

CVE-2026-20896 CRITICAL POC
9.8 Jul 03

Reverse-proxy authentication bypass in the official Gitea Docker image (versions up to and including 1.26.2) allows any

CVE-2026-59774 CRITICAL POC
9.8

Path traversal in Gitea's Org-mode (`.org`) markup renderer allows an attacker who can get Org-mode content rendered by

CVE-2026-58053 CRITICAL POC
9.4 Jun 28

Container escape in Gitea act_runner (Docker backend, through act 0.262.0) lets an authenticated user with workflow-exec

CVE-2019-11229 HIGH POC
8.8 Apr 15

models/repo_mirror.go in Gitea before 1.7.6 and 1.8.x before 1.8-RC3 mishandles mirror repo URL settings, leading to rem

CVE-2026-57894 HIGH POC
8.5 Jul 21

Server-side request forgery and internal repository exfiltration in Gitea before 1.27.0 lets a low-privileged authentica

CVE-2026-24791 HIGH POC
8.1 Jun 17

Authorization bypass in Gitea versions 1.22.3 through 1.26.1 allows holders of `public-only` access tokens or OAuth gran

Vendor StatusVendor

SUSE

Severity: Important
Product Status
SUSE Linux Enterprise Server 16.1 Affected
SUSE Linux Enterprise Server for SAP applications 16.1 Affected

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy