Bypass Email Verification over custom installation through "Login via Gitlab.com"
OmniAuth allowed users to sign in to a custom GitLab instance using their GitLab.com account, and the resulting account on the custom instance was marked as having a verified email even if the GitLab.com account's email was not verified. An attacker could thus verify any email address on a custom instance that enabled 'Sign in with GitLab.com', potentially gaining access to other resources if that instance acted as an OAuth provider.
GitLab
Originally disclosed on GitLab
- Fixed in 2 months
- Disclosed after 2 months
HackerOne report #764076 by rpadovani on 2019-12-24, assigned to @estrike:
Summary
OmniAuth allows registering to a custom installation of Gitlab through your account at Gitlab.com.
The freshly created account on the instance will be marked with email as "Verified" also if the original account on Gitlab.com is not.
Steps to reproduce
- Register with your fake email to Gitlab.com, e.g.
[email protected] - Go to an instance with "Sign in with Gitlab.com" enabled, e.g. https://gitlab.gnome.org
- Login with your fresh, not verified, Gitlab.com account
- You have now an account on https://gitlab.gnome.org with a verified email that you don't own
Impact
I can verify any email on a custom instance, if the "Login via gitlab.com" button is enabled.
This can be then (ab)used to gain access to other resources, if the custom Gitlab instance is used as Oauth Provider.
Examples
Screenshot from "gitlab.gnome.org", since it's the only public instance with login from Gitlab.com I know.
Profile: https://gitlab.gnome.org/rpoauth
What is the current bug behavior?
The email address is verified when clicking on "Login with Gitlab.com"
What is the expected correct behavior?
"Login with Gitlab.com" doesn't work if the email address on Gitlab.com is not verified
Output of checks
This bug happens on GitLab.gnome.org, I don't have access to env info
Impact
I can verify any email on a custom instance, if the "Login via gitlab.com" button is enabled.
This can be then (ab)used to gain access to other resources, if the custom Gitlab instance is used as Oauth Provider.
Attachments
Warning: Attachments received through HackerOne, please exercise caution!
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely, the OmniAuth integration did not check the email verification status from GitLab.com before marking the email as verified on the custom instance.
Impact
An attacker could verify any email on a custom instance if the 'Login via gitlab.com' button is enabled, and this could be abused to gain access to other resources if the instance is used as an OAuth provider.
What the attacker needed
A GitLab.com account with an unverified email; target instance has 'Sign in with GitLab.com' enabled
The fix
The 'Login with GitLab.com' should not work if the email address on GitLab.com is not verified.
How it was found
- Register with a fake email on GitLab.com.
- Go to a GitLab instance that has 'Sign in with GitLab.com' enabled.
- Log in with the new, unverified GitLab.com account.
- The account on the custom instance now has a verified email that the attacker does not own.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When you log into a website using another service (like GitLab.com), the website often trusts that the other service has checked your email. Here, the custom GitLab instance assumed the email was verified even when GitLab.com had not verified it. This let someone create an account with an email they did not own but that appeared verified.
What is Account takeover?
Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.