configure a redirect URI for Facebook OAuth
The Facebook OAuth flow on Gratipay allowed any redirect URI, so an attacker could craft a link that sent the OAuth authorisation code to a user-controlled profile page. That page could then leak the code via the Referer header or third-party images, potentially allowing the attacker to steal access tokens.
- Triaged in 23 days
- Fixed in 23 days
- Paid in 23 days
- Disclosed after 25 days
Hey,
Its me again. since the Login with Facebook doesnt have a dedicated directory like gratipay.com/facebook/callback it is possible to still steal access tokens.
As you can see it will send the token to my profile (/~attacka) and my profile points to example.com, if the user clicks on that link the referrer header will send tokenz (obviously lol)
gratipay also imports pictures from 3rd parties, forexample my img src is from ls.googleusercontent.com which means it will also leak the access_tokens to there.
Fix: add the redirect uri like: https://www.gratipay.com/facebook/callback so users have no way to tamper with it.
Thanks, P
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 OAuth implementation did not enforce a fixed redirect URI, allowing attackers to supply arbitrary redirect targets.
Impact
An attacker could steal OAuth access tokens via the leaked code.
What the attacker needed
Victim clicks a crafted link; attacker has a profile on the site
The fix
The OAuth implementation should enforce a fixed redirect URI, such as a dedicated callback endpoint, so users cannot tamper with it.
How it was found
- Craft a Facebook OAuth authorisation URL with the redirect_uri pointing to an attacker-controlled profile page on the target site.
- Ensure the attacker profile page redirects to an external site or contains third-party images.
- Send the crafted link to a victim; when clicked, the OAuth code is sent to the attacker's profile page.
- The code leaks via the Referer header or third-party image requests.
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 in with Facebook, Facebook sends a secret code back to the website. If the website doesn't check exactly where that code goes, an attacker can make it go to a page they control. Then they can grab the code and use it to access your account.
What is OAuth / SSO?
Mistakes in OAuth, OpenID Connect, SAML or token handling that leak codes and tokens or link an attacker's identity to a victim's account.