-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Only check access tokens if they are likely to be tokens #16164
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
Only check access tokens if they are likely to be tokens #16164
Conversation
Gitea will currently check every if every password is an access token even though most passwords are not and cannot be access tokens. By creation access tokens are 40 byte hexadecimal strings therefore only these should be checked. Signed-off-by: Andrew Thornton <[email protected]>
) Backprt go-gitea#16164 Gitea will currently check every if every password is an access token even though most passwords are not and cannot be access tokens. By creation access tokens are 40 byte hexadecimal strings therefore only these should be checked. Signed-off-by: Andrew Thornton <[email protected]>
…6171) Backprt #16164 Gitea will currently check every if every password is an access token even though most passwords are not and cannot be access tokens. By creation access tokens are 40 byte hexadecimal strings therefore only these should be checked. Signed-off-by: Andrew Thornton <[email protected]>
Marked as security because previously this would result in sending the last 8 characters of passwords to the dbs which with LOG_SQL=true means that they end up in logs. I think it's probably an acceptable balance that the lack of the appearance of a DB query leaks that the (provided) password is not a 40 character hexadecimal string, and that in the case of a 40 character hexadecimal password the last 8 characters may appear in the sql logs - we can do some other techniques in a future PR. (For example if a username is provided just get all the tokens for that user - if not leaking the last 8 characters is less of a problem.) |
) * Only check access tokens if they are likely to be tokens Gitea will currently check every if every password is an access token even though most passwords are not and cannot be access tokens. By creation access tokens are 40 byte hexadecimal strings therefore only these should be checked. Signed-off-by: Andrew Thornton <[email protected]>
Gitea will currently check every if every password is an access token even though
most passwords are not and cannot be access tokens.
By creation access tokens are 40 byte hexadecimal strings therefore only these should
be checked.
Signed-off-by: Andrew Thornton [email protected]