---
id: "CVE-2026-120263"
kind: "vulnerability"
aliases: ["CVE-2026-120263"]
title: "Gitea: OAuth2 account linking lets attacker take over other accounts"
severity: "high"
cvss: null
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["gitea", "oauth2", "package", "self-hosted"]
not_affected_if: ["default-config", "registration-disabled"]
published_at: "2026-11-01T10:18:37+00:00"
first_seen_at: "2026-11-01T10:49:34+00:00"
updated_at: "2026-11-01T10:51:19+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-120263", "first_seen_at": "2026-11-01T10:49:34+00:00"}]
---

# Gitea: OAuth2 account linking lets attacker take over other accounts

When Gitea's OAuth2 account linking is set to auto and registration is enabled, the sign-up form matched the account to link by a user name or email typed in the form rather than the identity from the OAuth2 provider. An attacker with an account on a configured OAuth2 provider could link their identity to another user's Gitea account, including an administrator, and sign in as that user without the password.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the `[oauth2_client]` section of the Gitea configuration for `ACCOUNT_LINKING` set to `auto`
- Check whether `[service]` registration (`DISABLE_REGISTRATION`) is enabled
- Check the Gitea version in use with `gitea --version`

## Fix

- The description says 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. The fixed version number is unknown.

## Timeline

- 2026-11-01T10:49:34+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-120263

## From the sources

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.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
