Time-of-check Time-of-use (TOCTOU) Race Condition in Gitea - CVE-2026-20779

 

Time-of-check Time-of-use (TOCTOU) Race Condition in Gitea - CVE-2026-20779

Published: June 22, 2026


Vulnerability identifier: #VU135007
CSH Severity: Medium
CVSS v4.0: CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N/E:U/U:Green
CVE-ID: CVE-2026-20779
CWE-ID: CWE-367
Exploitation vector: Remote access
Exploit availability: No public exploit available
Vendor: The Gitea Authors
Affected software:
Gitea

Detailed vulnerability description

The vulnerability allows a remote attacker to bypass one-time password replay protections and create multiple authenticated sessions.

The vulnerability exists due to a time-of-check time-of-use race condition in the web 2fa login and password-reset 2fa re-auth handlers when processing parallel submissions of the same totp passcode. A remote attacker can send parallel requests with the same captured passcode to bypass one-time password replay protections and create multiple authenticated sessions.

User interaction is required because the victim must complete a login flow that supplies a live totp value.


How to mitigate CVE-2026-20779

Install security update from vendor's website.

Sources