/

CVE-2026-96404

Severity:

HIGH RISK

(8.1)

Authentication Bypass (CWE-287) in Gitea Web Installer

CVE-2026-96404

Analyzed

Vulnerability type

Category:

Authentication Bypass

CWE:

CWE-287

Impact:

Account Takeover and Administrative Access

Severity:

HIGH RISK

(8.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A flaw in Gitea's web installer can create an authenticated session for an existing user without verifying that user's password when the installer is reachable against a populated database. If the matched account has administrator privileges, this may enable full administrative access, including password changes.

A flaw in Gitea's web installer can create an authenticated session for an existing user without verifying that user's password when the installer is reachable against a populated database. If the matched account has administrator privileges, this may enable full administrative access, including password changes.

Affected context

The issue can arise when Gitea's web installer remains reachable after initialization or when its installation lock has been reset while the database still contains user accounts. Risk is increased when an installer submission accepts an existing administrator username and the deployment does not require explicit confirmation before reinstalling or reconfiguring the instance.

The issue can arise when Gitea's web installer remains reachable after initialization or when its installation lock has been reset while the database still contains user accounts. Risk is increased when an installer submission accepts an existing administrator username and the deployment does not require explicit confirmation before reinstalling or reconfiguring the instance.

Exploit preconditions

  • Attack surface: Gitea's web installer or installation configuration endpoint
  • Required access: Network access to the reachable installer; no valid password for the matching account is required by the flawed flow
  • Trigger point: Submission of installation details containing an existing username
  • Why exploitation is possible: The installer establishes an authenticated session based on username matching without performing the expected password verification
  • Additional condition: The installation lock must be disabled, reset, or otherwise fail to prevent access to the installer
  • Attack surface: Gitea's web installer or installation configuration endpoint
  • Required access: Network access to the reachable installer; no valid password for the matching account is required by the flawed flow
  • Trigger point: Submission of installation details containing an existing username
  • Why exploitation is possible: The installer establishes an authenticated session based on username matching without performing the expected password verification
  • Additional condition: The installation lock must be disabled, reset, or otherwise fail to prevent access to the installer

Why this happens

The underlying bug is an authentication decision based on account identity without validating the corresponding authentication secret. During installation, the application treated a submitted administrator username as sufficient to associate the new session with an existing account, rather than requiring password verification and a controlled reinstallation workflow. This behavior maps to CWE-287: Improper Authentication, because the system did not adequately verify that the requester was authorized to act as the identified user.

The underlying bug is an authentication decision based on account identity without validating the corresponding authentication secret. During installation, the application treated a submitted administrator username as sufficient to associate the new session with an existing account, rather than requiring password verification and a controlled reinstallation workflow. This behavior maps to CWE-287: Improper Authentication, because the system did not adequately verify that the requester was authorized to act as the identified user.

Potential impact

  • An attacker may obtain an authenticated session for an existing account.
  • An attacker could gain full administrative access when the matched account has administrator privileges.
  • Account passwords may be changed, potentially locking out legitimate users.
  • Repository data, settings, integrations, and other instance resources could be modified.
  • The Gitea instance could be used to support further organizational compromise.
  • An attacker may obtain an authenticated session for an existing account.
  • An attacker could gain full administrative access when the matched account has administrator privileges.
  • Account passwords may be changed, potentially locking out legitimate users.
  • Repository data, settings, integrations, and other instance resources could be modified.
  • The Gitea instance could be used to support further organizational compromise.

General mitigation guidance

Mitigation generally focuses on keeping the installation workflow inaccessible after initialization and ensuring every transition into an authenticated account requires strong identity verification.

Common defensive patterns include:

  • Enforcing an immutable or tightly controlled installation lock after initial setup.
  • Requiring explicit, separately authorized confirmation before any reinstall or configuration reset.
  • Never creating authenticated sessions for existing accounts based only on submitted usernames.
  • Requiring password or equivalent administrator verification before modifying an existing account.
  • Restricting installer exposure through network controls, administrative access boundaries, and deployment policy.
  • Applying least privilege to service and administrator accounts and monitoring changes to authentication settings.

Mitigation generally focuses on keeping the installation workflow inaccessible after initialization and ensuring every transition into an authenticated account requires strong identity verification.

Common defensive patterns include:

  • Enforcing an immutable or tightly controlled installation lock after initial setup.
  • Requiring explicit, separately authorized confirmation before any reinstall or configuration reset.
  • Never creating authenticated sessions for existing accounts based only on submitted usernames.
  • Requiring password or equivalent administrator verification before modifying an existing account.
  • Restricting installer exposure through network controls, administrative access boundaries, and deployment policy.
  • Applying least privilege to service and administrator accounts and monitoring changes to authentication settings.

How teams detect issues like this

Organizations can look for:

  • Static analysis and code review findings where usernames or account identifiers directly establish authenticated sessions.
  • Installer paths that access existing user records without a corresponding password, token, or administrator reauthentication check.
  • Configuration changes that disable or reset installation locks in production environments.
  • Audit events showing installer submissions, unexpected administrator sessions, password changes, or account modifications near installation activity.
  • Policy enforcement that prevents production deployments from exposing initialization endpoints or permitting unauthorized configuration resets.

Automated security review tools can help identify authentication flows that trust identity claims without validating the required credentials.

Organizations can look for:

  • Static analysis and code review findings where usernames or account identifiers directly establish authenticated sessions.
  • Installer paths that access existing user records without a corresponding password, token, or administrator reauthentication check.
  • Configuration changes that disable or reset installation locks in production environments.
  • Audit events showing installer submissions, unexpected administrator sessions, password changes, or account modifications near installation activity.
  • Policy enforcement that prevents production deployments from exposing initialization endpoints or permitting unauthorized configuration resets.

Automated security review tools can help identify authentication flows that trust identity claims without validating the required credentials.

Sources

SourceLink
blog.gitea.comblog.gitea.com/release-of-28.0.0/
github.comgithub.com/go-gitea/gitea/pull/39400
github.comgithub.com/go-gitea/gitea/releases/tag/v28.0.0
github.comgithub.com/go-gitea/gitea/security/advisories/GHSA-9h7g-h754-c8x2

Frequently asked

questions

It may be exploitable remotely when the Gitea web installer is network-reachable and the installation lock has been disabled or reset. Exposure depends on deployment configuration and network controls.

No valid password for the matched existing account is expected to be required in the vulnerable flow. Access to the installer and knowledge of an existing username are the important conditions.

Keep the installer inaccessible after initialization, prevent unauthorized installation-lock changes, and require explicit administrator reauthentication before any operation can associate a session with an existing account.

Treat account identifiers as untrusted claims, require independent credential verification for authentication decisions, protect initialization endpoints, and monitor account and installation-state changes.

It may be exploitable remotely when the Gitea web installer is network-reachable and the installation lock has been disabled or reset. Exposure depends on deployment configuration and network controls.

No valid password for the matched existing account is expected to be required in the vulnerable flow. Access to the installer and knowledge of an existing username are the important conditions.

Keep the installer inaccessible after initialization, prevent unauthorized installation-lock changes, and require explicit administrator reauthentication before any operation can associate a session with an existing account.

Treat account identifiers as untrusted claims, require independent credential verification for authentication decisions, protect initialization endpoints, and monitor account and installation-state changes.

Find out what's already
exploitable in your codebase.