Summary
CVE-2026-96404 is an authentication bypass in Gitea’s web installer that allows an attacker to obtain an authenticated session for an existing user account — including an administrator account — without supplying a valid password. The flaw affects Gitea v1.27.3 and earlier when the /install installer endpoint is reachable against a database that already contains user records, and it carries a CVSS v3.1 base score of 8.1 (High).
Technical details
- Root cause: when the installer’s
CreateUsercall fails withErrUserAlreadyExist(because the submitted username already exists in the database), Gitea falls back to loading the existing user record viaGetUserByNameand proceeds to issue an authenticated session token without ever verifying the submitted password. - A related safeguard,
HasPostInstallationUsers(), which is meant to block the installer from running again once the instance is already populated, only triggers when 2 or more users exist — so databases containing a single (admin) account skip the reinstall confirmation entirely. - Trigger conditions: the installer is reachable when
INSTALL_LOCKisfalseagainst a database that already has data. This can occur in real deployments where application storage (e.g., a container volume or PVC) is re-provisioned or restored separately from the backing database, causing Gitea to think it is a fresh install while the database still holds existing accounts. - Attack vector: network, unauthenticated, requires no user interaction. An attacker submits the install form using a username that matches an existing (ideally administrator) account; no correct password is required.
- Impact: the attacker is granted a fully authenticated session for that account. If the matched account is an administrator, this yields complete administrative control of the Gitea instance, including the ability to change the account’s password and lock out the legitimate owner.
Affected software
- Gitea versions up to and including v1.27.3
- Fixed in Gitea v28.0.0
Severity
- CVSS v3.1 Base Score: 8.1 (High)
- Vector:
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness classification: CWE-287 (Improper Authentication) / CWE-306 (Missing Authentication for Critical Function)
Mitigation and recommended actions
- Immediate: upgrade to Gitea v28.0.0 or later, which removes the silent fallback to an existing account and issuance of a session without password verification, and corrects the reinstall-confirmation check.
- If an immediate upgrade is not possible:
- Ensure
INSTALL_LOCKis set totrueinapp.inion every running instance and verify it is not reset when storage/volumes are redeployed or restored. - Make sure the
/installpath is never reachable from the network once an instance has been initialized — restrict it at the network/proxy layer as defense in depth. - Audit deployment pipelines (containers, PVCs, backups) to ensure application data volumes and the backing database are always provisioned/restored together, preventing a state where the app believes it is uninstalled while the database retains existing users.
- Ensure

