Chained Bugs to Leak Victim's Uber's FB Oauth Token
The Facebook OAuth application accepted any redirect_uri matching a broad pattern, and the next_url parameter could be chained with a logout endpoint that redirected based on the Referer header. An attacker could craft a single URL that prompted OAuth authorisation and then leaked the victim's token to an attacker-controlled site, enabling account takeover.
- Triaged in 17 hours
- Fixed in 6 days
- Paid in 13 days
- Disclosed after 24 months
Summary by the program
The Facebook OAuth application was misconfigured to allow any URL that followed the https://auth.uber.com/login?* format to be provided as a redirect_uri. By taking advantage of this, @ngalog was able to discover that the next_url parameter could be added to the redirect_uri allowing it to be chained further. Next, @ngalog found that the https://login.uber.com/logout endpoint would redirect based on the Referer header, making it possible to chain together another redirect. By piecing this together, @ngalog was able to provide us with an awesome single-URL PoC which would:
- Prompt OAuth authorization on
facebook.com - Redirect to
https://auth.uber.com/login?next_url=https://login.uber.com/logoutfrom Facebook - Redirect to
https://login.uber.com/logoutfromauth.uber.com - Redirect to attacker site from Referer header and return the token
When combined, this would have allowed for a full account takeover and was a very creative and cool bug.
Nice work, @ngalog!
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 redirect_uri validation used a wildcard pattern that allowed chaining with an open redirect via the next_url parameter and a Referer-based redirect on the logout endpoint.
Impact
This could have allowed a full account takeover by leaking the victim's OAuth token to an attacker-controlled site.
What the attacker needed
Victim clicks a crafted link; victim authorises the OAuth app
How it was found
- The attacker provides a redirect_uri that matches the allowed pattern and includes a next_url parameter pointing to the logout endpoint.
- The victim is prompted to authorise the OAuth application on Facebook.
- Facebook redirects to the auth.uber.com login URL with the next_url parameter.
- auth.uber.com redirects to the logout endpoint specified in next_url.
- The logout endpoint redirects based on the Referer header to an attacker-controlled site.
- The attacker's site receives the OAuth token.
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.
OAuth is a way for websites to let you log in with another service, like Facebook. The service sends you back to the website with a special code or token. If the website accepts too many different return addresses, an attacker can trick it into sending that token to their own site, letting them take over 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.