Omniauth `google_auth2/omniauth_error` endpoint renders arbitrary error message
The OAuth error endpoint reflected an arbitrary error message supplied in the URL parameter, allowing an attacker to display fake content on the legitimate GitLab domain. An attacker could craft a link that shows a misleading message to users, potentially for phishing or SEO abuse.
GitLab
Originally disclosed on GitLab
- Fixed in 22 months
- Disclosed after 22 months
HackerOne report #438746 by h33t on 2018-11-10:
Hi,
While testing gitlab i have come across a bug where it seemed like users can get manipulated or malicious message could be spread by that vulnerable URL.
Content spoofing is a type of exploit used by a malicious hackers to present a faked or modified Web site to the user as if it were legitimate. The intent is, typically, to defraud victims although sometimes the purpose is simply to misrepresent an organization or an individual.
#Reproduction Steps
-
Access the URL
-
In the error parameter put your message.
Impact
One thing i have thought of this attack is that attackers might try to publish such url in google using seo so then you dont need to send it to a specific user to show the message. If they can publish it on search engines easily a lot of users will get the malicious message of the attacker.
From the Security Department:
Fixed error messages should be displayed for valid error codes from the OAuth specification, any invalid error code should render a "Invalid error code received" or other generic error message.
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 application reflected the user-supplied 'error' parameter directly into the error page without validating or escaping it.
Impact
An attacker could spread a malicious or misleading message via a legitimate GitLab URL, potentially tricking users or abusing search engine indexing.
What the attacker needed
None
The fix
The endpoint should display fixed error messages for valid OAuth error codes and a generic message for invalid ones.
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 a website shows an error message, it should not simply repeat whatever text is in the link. Here, the site took the 'error' value from the URL and displayed it as-is, so anyone could make the page say anything they wanted. This is called content spoofing: making a fake message appear to come from a trusted site.
What is Misconfiguration?
Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.