CVE-2026-120263

Gitea OAuth2 account auto-linking takeover through the sign-up form

Published Nov 1, 2026 CVSS 3.1 · 9.8 Critical EPSS < 1% KEV · Not listed
Description
When `[oauth2_client].ACCOUNT_LINKING` is set to `auto` (not the default) and registration is enabled, the link-account sign-up form looked up the existing account to link by the user name or email submitted in the form instead of the identity asserted by the OAuth2 provider. An attacker with an account on a configured OAuth2 provider could submit another user's name, link their external identity to that Gitea account and be signed in as it without its password, including as an administrator. The link persisted for later sign-ins. Automatic linking now only happens when the existing account matches the provider's email or provider-derived user name; otherwise the account password is required.

Analysis

AI-generated

Technical impact

The vulnerability arises when the Gitea configuration option [oauth2_client].ACCOUNT_LINKING is set to auto and user registration is enabled. Instead of validating the identity asserted by the OAuth2 provider, the sign‑up form matches the submitted user name or email address against existing accounts. An attacker who possesses an account on the configured OAuth2 provider can submit the name or email of any other user, link their external identity to that account, and gain authentication without the account’s password—including administrative privileges. This is a classic authentication bypass and account compromise flaw classified as CWE-287 and CWE-639.

Affected Systems

All Gitea installations that enable automatic OAuth2 account linking (ACCOUNT_LINKING set to "auto") and have user registration turned on. Prior to the introduction of the fix in release 28.3.0, any version exposed to this configuration was vulnerable. Users running older versions with the auto‑linking setting should verify whether such a setting is present and address it accordingly.

Risk and Exploitability

The CVSS score of 9.8 indicates a critical risk. The exploit requires only an OAuth2 account and the ability to submit a crafted sign‑up form to the target Gitea instance. Once the external identity is linked, the victim’s account becomes fully authenticated, and the vulnerability persists for subsequent logins. With no known public exploits and an EPSS score of <1%, the practical exploitation risk depends on the attacker’s control over an OAuth2 provider account. The flaw is severe enough that it is listed in the vendor’s advisory and fixed in the latest release.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Gitea to version 28.3.0 or later, which restricts automatic linking to accounts that match the provider’s email or derived user name and requires a password for other linkages.
  • If immediate upgrade is not possible, disable automatic OAuth2 account linking by setting [oauth2_client].ACCOUNT_LINKING to "none" or "manual" in the configuration, making account linking require explicit user action.
  • Remove or disable user registration until a patch is applied, or enforce that registration requires an existing Gitea account before linking, to prevent external identities from being linked to arbitrary accounts.

Generated by OpenCVE AI on November 6, 2026 at 17:47 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
Metrics cvssV3_1

{'score': 9.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'}

Type Values Removed Values Added
First Time appeared Gitea
Gitea gitea
Vendors & Products Gitea
Gitea gitea
Type Values Removed Values Added
Description When `[oauth2_client].ACCOUNT_LINKING` is set to `auto` (not the default) and registration is enabled, the link-account sign-up form looked up the existing account to link by the user name or email submitted in the form instead of the identity asserted by the OAuth2 provider. An attacker with an account on a configured OAuth2 provider could submit another user's name, link their external identity to that Gitea account and be signed in as it without its password, including as an administrator. The link persisted for later sign-ins. Automatic linking now only happens when the existing account matches the provider's email or provider-derived user name; otherwise the account password is required.
Title Gitea OAuth2 account auto-linking takeover through the sign-up form
Weaknesses CWE-287
CWE-639
References
Weaknesses
  • CWE-287

    Improper Authentication

  • CWE-639

    Authorization Bypass Through User-Controlled Key

Sources

Status
PUBLISHED
Assigner
Gitea
Published
Updated
Nov 6, 2026, 3:43 PM
Reserved
Nov 1, 2026, 8:48 AM
Status
Deferred
Published
Nov 1, 2026, 10:18 AM
Modified
Nov 6, 2026, 4:17 PM