Every CVE Search/ Get API key

CVE-2021-45331

Reuse of one time passwords allowed in Gitea

9.8 CriticalFix available

An Authentication Bypass vulnerability exists in Gitea before 1.5.0, which could let a malicious user gain privileges. If captured, the TOTP code for the 2FA can be submitted correctly more than once.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
High
Integrity
High
Availability
High

Exploit likelihood

1.44%Up 0.5 points since Feb 10, 2022
90%50%10%1%

What each source reports

NVD Score used 9.8

An Authentication Bypass vulnerability exists in Gitea before 1.5.0, which could let a malicious user gain privileges. If captured, the TOTP code for the 2FA can be submitted correctly more than once.

Record
CVE-2021-45331
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS 2.0
7.5 HighAV:N/AC:L/Au:N/C:P/I:P/A:P
Weakness
CWE-287
Updated
2026-11-02
CVE List No score

An Authentication Bypass vulnerability exists in Gitea before 1.5.0, which could let a malicious user gain privileges. If captured, the TOTP code for the 2FA can be submitted correctly more than once.

Record
CVE-2021-45331
Updated
2026-11-02
EUVDEUVD-2022-1043 No score

An Authentication Bypass vulnerability exists in Gitea before 1.5.0, which could let a malicious user gain privileges. If captured, the TOTP code for the 2FA can be submitted correctly more than once.

Record
EUVD-2022-1043
Updated
2026-11-03
GitHub AdvisoriesGHSA-hfmf-q69j-6m5p 9.8

Reuse of one time passwords allowed in Gitea

An Authentication Bypass vulnerability exists in Gitea before 1.5.0, which could let a malicious user gain privileges. If captured, the TOTP code for the 2FA can be submitted correctly more than once.

Record
GHSA-hfmf-q69j-6m5p
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-287
Updated
2026-11-02
OSVALPINE-CVE-2021-45331 9.8

An Authentication Bypass vulnerability exists in Gitea before 1.5.0, which could let a malicious user gain privileges. If captured, the TOTP code for the 2FA can be submitted correctly more than once.

Record
ALPINE-CVE-2021-45331
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-03
OSV 9.8

An Authentication Bypass vulnerability exists in Gitea before 1.5.0, which could let a malicious user gain privileges. If captured, the TOTP code for the 2FA can be submitted correctly more than once.

Record
CVE-2021-45331
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVGHSA-hfmf-q69j-6m5p 9.8

Reuse of one time passwords allowed in Gitea

An Authentication Bypass vulnerability exists in Gitea before 1.5.0, which could let a malicious user gain privileges. If captured, the TOTP code for the 2FA can be submitted correctly more than once.

Record
GHSA-hfmf-q69j-6m5p
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-287
Updated
2026-11-02
OSVBIT-gitea-2021-45331 No score

An Authentication Bypass vulnerability exists in Gitea before 1.5.0, which could let a malicious user gain privileges. If captured, the TOTP code for the 2FA can be submitted correctly more than once.

Record
BIT-gitea-2021-45331
Updated
2026-11-02
OSVGO-2022-0315 No score

Reuse of one time passwords allowed in Gitea in code.gitea.io/gitea

Reuse of one time passwords allowed in Gitea in code.gitea.io/gitea

Record
GO-2022-0315
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
code.gitea.io/gitea
Go
before 1.5.0
1.5.0
gitea
Alpine:v3.16
before 1.5.1-r0
1.5.1-r0
gitea
Alpine:v3.17
before 1.5.1-r0
1.5.1-r0
gitea
Alpine:v3.18
before 1.5.1-r0
1.5.1-r0
gitea
Alpine:v3.19
before 1.5.1-r0
1.5.1-r0
gitea
Alpine:v3.20
before 1.5.1-r0
1.5.1-r0
gitea
Alpine:v3.21
before 1.5.1-r0
1.5.1-r0
gitea
Alpine:v3.22
before 1.5.1-r0
1.5.1-r0
gitea
Alpine:v3.23
before 1.5.1-r0
1.5.1-r0
gitea
Alpine:v3.24
before 1.5.1-r0
1.5.1-r0
gitea
Bitnami
before 1.5.0
1.5.0

History

History
RecordedChangedSources
affected, aliases, referencesOSV
aliasesEUVD
first indexedCVE List, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2021-45331 is a critical vulnerability (CVSS 9.8) in Gitea, published February 9, 2022. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.44%, the 73rd percentile. Fixed in code.gitea.io/gitea 1.5.0.

References

MoveEnter Open