Description
Gitea versions from 1.5.0 before 1.26.3 have a TOTP single-use enforcement defect that allows a valid TOTP code to be accepted more than once across web two-factor authentication flows and the Basic Auth X-Gitea-OTP path.
Published: 2026-07-03
Score: 7.1 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Gitea versions from 1.5.0 through before 1.26.3 contain a flaw in the two‑factor authentication logic that permits a valid TOTP code to be accepted more than once. The single‑use rule normally enforces that one‑time passwords cannot be reused, so the defect allows an attacker to replay a captured OTP. This improper authentication weakness (CWE‑294) can lead to unauthorized authentication and the subsequent ability to access repository data available to the authenticated user.

Affected Systems

The vulnerability affects the Gitea open‑source Git server, including all releases from 1.5.0 up to but not including 1.26.3. It manifests in both the web‑based two‑factor login flow and the Basic Authentication X‑Gitea‑OTP header. Systems running any unpatched version with active user accounts are at risk.

Risk and Exploitability

The CVSS score of 7.1 indicates a high severity issue. The EPSS score of <1% reflects a low probability of exploitation, and the vulnerability is not listed in the CISA KEV catalog. The likely attack vector (inferred) is that an attacker who intercepts a legitimate OTP during a login or API request can replay it before expiration to bypass the single‑use enforcement. If such a replay occurs, the attacker could gain authenticated access and perform any actions that the legitimate user is permitted to carry out.

Generated by OpenCVE AI on July 24, 2026 at 10:41 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade Gitea to version 1.26.3 or newer, which contains the fix for the TOTP replay issue.
  • Restart the Gitea service after the upgrade to clear any in‑memory state that might still allow stale OTPs.
  • Enable authentication audit logging to detect and alert on duplicate OTP submissions occurring within a short period of time.

Generated by OpenCVE AI on July 24, 2026 at 10:41 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-gx3v-q759-g323 Gitea: TOTP TOCTOU race on web 2FA paths + missing replay check on Basic-Auth `X-Gitea-OTP` surface
History

Tue, 07 Jul 2026 18:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Mon, 06 Jul 2026 23:15:00 +0000

Type Values Removed Values Added
First Time appeared Gitea
Gitea gitea Open Source Git Server
Vendors & Products Gitea
Gitea gitea Open Source Git Server

Fri, 03 Jul 2026 20:45:00 +0000

Type Values Removed Values Added
Description Gitea versions from 1.5.0 before 1.26.3 have a TOTP single-use enforcement defect that allows a valid TOTP code to be accepted more than once across web two-factor authentication flows and the Basic Auth X-Gitea-OTP path.
Title Gitea TOTP single-use enforcement defect allows OTP replay
Weaknesses CWE-294
References
Metrics cvssV3_1

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


Subscriptions

Gitea Gitea Open Source Git Server
cve-icon MITRE

Status: PUBLISHED

Assigner: Gitea

Published:

Updated: 2026-07-07T17:00:54.312Z

Reserved: 2026-03-03T03:26:00.104Z

Link: CVE-2026-20779

cve-icon Vulnrichment

Updated: 2026-07-06T19:02:19.827Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-07-24T10:45:03Z

Weaknesses
  • CWE-294

    Authentication Bypass by Capture-replay