-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improving authentication with hardware keys / FIDO2 / webauthn + 2FA #21675
Comments
|
If you look closely, you see that it's still 2FA: The decision here is how much effort the gitea project is willing to put into changing this auth logic, with the possible gain of having an unphishable authentication method (to be clear, Gitea currently has this property (since #11573), so we should think hard about dropping it). |
Was about to create a dedicated issue, but found this one, when searching for existing ones, so I'll add another improvement. Gitea's WebAuthn does not save the domain string. Information about the topic follows. |
Gitea's auth has a more complex situation. Some users want to login with a third auth server i.e. OAuth2 . I think we need to put all these situations together when refactoring/redesigning. |
I would like to catch up on the statement of the beginning of this issue:
Webauthn was designed as a generic, phishing proof protocol and therefore can be used for passwordless authentication. It brings it's own function of a 2nd factor (where you can use a 2F to access your local public key) but is also downward compatible as a 2F with U2F. That's a bit confusing. Because the domain is (as the relying party RP) fundamental part of the authentication process in webauthn, there is a drastically reduced attack vector for phishing in webauthn compared to U2F, because you just cannot use your credentials on a different site, without tampering your local machine. When it comes to the implementation, then you actually do not use (or strictly saying, you do not have to use) a username anymore, because you are working with a publickey authentication approach. So I totally agree with what @lunny said, that
because there would be actually a pool of equal authentication methods/backends, every with their own set of credentials:
This is indeed a lot of effort to implement. However, considering the move of bigtechs towards Passkeys and being already available on most platforms, this is worth the discussion and integration. Github just announced few days ago, that they now support passkey authentification as well. Paypal, Google, Apple are alreading doing it. My point is, when tackling the described issues, I would suggest to refactor it in a way that the whole picture is considered as it is discussed in #24821. I think this will give more momentum. A first approach can be hanko.io. |
The Problem
Possbile Solutions
(1) The Very Simple Fix
Revert #11573, but otherwise leave the auth conditions as they are. Fixes the UI inconsistency and the no-backup code situation, implements github's authentication logic, but does not enable passwordless login and makes phishable credentials mandatory.
(2) The Somewhat Simple Fix
This mostly keeps the current auth logic, except for requiring a backup second factor to be set up:
This auth logic does not require phishable credentials.
(3) The Correct Solution
The most correct way imho would be to implement the auth logic that is outlined below as Nextcloud's implementation.
Effectively the needed changes would be:
This would result in the following auth logic:
Of course not all of those credentials need to be used, all but one from each block could be unavailable/unknown. This option has the benefit to get along without mandatory phishable credentials (password, TOTP), as well as enabling passwordless auth.
Context
Gitea's current (as of 1.18.0+dev-558-g94d6d93cc, 94d6d93) authentication behaviour is as follows:
username && pw
username && pw && (totp || backupkeys)
username && pw && (fidokey1 || fidokey2)
username && pw && (fidokey1 || fidokey2 || totp || backupcodes)
For reference some other implementations of FIDO2:
username && pw && emailed-token
username && pw && (totp || backupkeys)
username && pw && (fidokey1 || fidokey2 || totp || backupcodes)
username && pw
username && pw && (totp || backupkeys)
username && (pw || fidokey1 || fidokey2)
username && (pw || fidokey1 || fidokey2) && (totp || backupcodes)
As you can see, there is no clear correct de-facto implementation, I have yet to check fido2/webauthn spec if there is a
correctapproved way of implementing things. However there is a strong preference in the wider community on how to do things correctly with security and usability in mind:The text was updated successfully, but these errors were encountered: