Skip to content
Snippets Groups Projects

Prevent invalid tokens from falling back to Git password auth

Merged Drew Blessing requested to merge dblessing_prevent_git_token_fallback into master

What does this MR do and why?

Prevent invalid tokens from falling back to Git password auth

When authenticating with Git over HTTPS, authentication falls through a number of mechanisms since Git password may be a token, local database password, LDAP password and more. This change ensures that any recognized token type does not fallback to database or LDAP authentication, for example, when the token is revoked or expired.

This is important because otherwise if a user's personal access token expires then an integration could continuously try to authenticate with GitLab and cause the user's GitLab or LDAP account to become blocked.

Risks

It is theoretically possible that we could have users with passwords that begin with the same characters as the prefixes to our tokens. I believe it would need to include the dash, such as glpat- to match. It's probably not likely but possible. With this change, any such user would be unable to authenticate with Git over HTTPS (or potentially other sessionless authentication that uses the same auth path).

References

#354462 (closed)

Screenshots or screen recordings

Before After

How to set up and validate locally

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Drew Blessing

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading