CSRF token on login #998

Closed
opened 2025-11-02 03:44:39 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @daviian on GitHub (Aug 24, 2017).

  • Gitea version (or commit ref): f61a1d21
  • Git version: 2.13.3
  • Operating system: Mac OS X
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant

Description

After discussion in https://github.com/go-gitea/gitea/pull/2363#pullrequestreview-58278319 I checked if login is validating CSRF token. And it does not.
As opinions differ I want to start a discussion about the necessity of a token validation for login request.

A research lead me to https://stackoverflow.com/questions/6412813/do-login-forms-need-tokens-against-csrf-attacks/15350123#15350123, the guy describes a scenario in which not validating the csrf token on login page is used for an attack on data privacy.

What's your opinion on this guys? IMO I would add token validation for login.

Originally created by @daviian on GitHub (Aug 24, 2017). - Gitea version (or commit ref): f61a1d21 - Git version: 2.13.3 - Operating system: Mac OS X - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant ## Description After discussion in https://github.com/go-gitea/gitea/pull/2363#pullrequestreview-58278319 I checked if login is validating CSRF token. And it does not. As opinions differ I want to start a discussion about the necessity of a token validation for login request. A research lead me to https://stackoverflow.com/questions/6412813/do-login-forms-need-tokens-against-csrf-attacks/15350123#15350123, the guy describes a scenario in which not validating the csrf token on login page is used for an attack on data privacy. What's your opinion on this guys? IMO I would add token validation for login.
GiteaMirror added the type/proposal label 2025-11-02 03:44:39 -06:00
Author
Owner

@daviian commented on GitHub (Sep 30, 2017):

Anyone against a CSRF token on login?
If not I would create a PR for this,

@daviian commented on GitHub (Sep 30, 2017): Anyone against a CSRF token on login? If not I would create a PR for this,
Author
Owner

@lunny commented on GitHub (Oct 7, 2017):

@daviian maybe because drone depends on that?

@lunny commented on GitHub (Oct 7, 2017): @daviian maybe because drone depends on that?
Author
Owner

@daviian commented on GitHub (Oct 7, 2017):

@lunny Any reason why the drone should depend on that?

@daviian commented on GitHub (Oct 7, 2017): @lunny Any reason why the drone should depend on that?
Author
Owner

@lunny commented on GitHub (Oct 7, 2017):

@daviian since Gitea didn't implement OAuth2 provider. But drone need login with gitea user & password.

@lunny commented on GitHub (Oct 7, 2017): @daviian since Gitea didn't implement OAuth2 provider. But drone need login with gitea user & password.
Author
Owner

@daviian commented on GitHub (Oct 7, 2017):

@lunny When does the drone need direct login to gitea, except when running integration tests? And integration tests already send csrf token on login, although the token is not validated.

@daviian commented on GitHub (Oct 7, 2017): @lunny When does the drone need direct login to gitea, except when running integration tests? And integration tests already send csrf token on login, although the token is not validated.
Author
Owner

@6543 commented on GitHub (Sep 7, 2020):

Gitea has implemented OAuth2 provider

@6543 commented on GitHub (Sep 7, 2020): Gitea **has** implemented OAuth2 provider
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#998