Block password-only auth when 2FA is enabled #579

Closed
opened 2025-11-02 03:28:43 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @rugk on GitHub (Mar 27, 2017).

  • Gitea version (or commit ref): 1.1.0
  • Operating system: Debian
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
    • Not tested yet

Description

When 2FA is enabled Gitea should block the authentication via password and require auth tokens.
The current behaviour is to allow authentication via git even with 2FA enabled. This, however, defeats the whole point of 2FA: This way users/attackers can perform git actions (aka login, push code, etc.) without authenticating with the 2FA method.

Originally created by @rugk on GitHub (Mar 27, 2017). - Gitea version (or commit ref): 1.1.0 - Operating system: Debian - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [ ] Not relevant - [x] Not tested yet ## Description When 2FA is enabled Gitea should block the authentication via password and require auth tokens. The current behaviour is to allow authentication via git even with 2FA enabled. This, however, defeats the whole point of 2FA: This way users/attackers can perform git actions (aka login, push code, etc.) without authenticating with the 2FA method.
GiteaMirror added the type/bug label 2025-11-02 03:28:43 -06:00
Author
Owner

@lunny commented on GitHub (Mar 28, 2017):

@minecrafter maybe you can see this issue.

@lunny commented on GitHub (Mar 28, 2017): @minecrafter maybe you can see this issue.
Author
Owner

@minecrafter commented on GitHub (Mar 31, 2017):

I might be able to find time to work on this next week.

@minecrafter commented on GitHub (Mar 31, 2017): I might be able to find time to work on this next week.
Author
Owner

@moritzheiber commented on GitHub (Jul 19, 2017):

@minecrafter This is a serious security issue, as users are able to circumvent 2FA with regular Git commands .. could this be re-prioritized? IMHO it needs fixing yesterday 😦

@moritzheiber commented on GitHub (Jul 19, 2017): @minecrafter This is a serious security issue, as users are able to circumvent 2FA with regular Git commands .. could this be re-prioritized? IMHO it needs fixing yesterday :frowning:
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#579