Skip to content
go-gitea/gitea·Indexed by this site · Originally published· Event →

Taking Over Gitea Accounts via OAuth2 Automatic Linking and an Attacker-Controllable Username

Account Takeover via OAuth2 Auto-Linking with Attacker-Controlled Username

AI summary

Gitea has a high-severity account takeover vulnerability (CVE-2026-120263); versions 28.2.0 and earlier are affected, and it has been fixed in 28.3.0. When OAuth2's ACCOUNT_LINKING is set to auto (a non-default configuration), an attacker authenticates with their own identity at the OAuth2 provider and then submits the victim's username in the linking registration form; createUserInContext looks up the account using this attacker-controllable field rather than the value asserted by the identity provider, linking the attacker's external identity to the victim's account and issuing a session for the victim. The linking record persists across sessions, constituting a permanent backdoor; after taking over an administrator account, the attacker can access the admin panel and all repositories. The default configuration ACCOUNT_LINKING = login is not affected. The vulnerability is also accompanied by a WebAuthn bypass: the automatic linking flow only checks TOTP, so users configured with only WebAuthn will not encounter a second-factor verification prompt.

Read originalgithub.com