No redirect uri for Twitter Oath resulting in token leak
The OAuth authorisation endpoint for Twitter accepted a user-controlled 'next' parameter that determined where the OAuth token was sent after authorisation. An attacker could change this parameter to redirect the token to a profile page they control, leaking the token.
- Triaged in 2 hours
- Fixed in 2 days
- Disclosed after 2 days
Good afternoon,
There's an opportunity to steal Oath tokens upon the return uri in the following redirect.
If I change the &next= to my profile for example /@5e22456d-9aae-4267-b1a9-4315c2605d89
This results in an open redirect to my main profile leaking the Oauth token:
#POC
results in F199105
Here's a video demonstrating the vulnerability. F199111
#Patch Add a redirect uri that can't be tampered with.
#References
This is almost the exact same scenario that is in this report. https://hackerone.com/reports/140432
Attachments

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 flow used a user-supplied 'next' parameter as the redirect destination without validating it against a fixed allowlist, allowing an open redirect that exposed the token.
What the attacker needed
Attacker crafts a link with a modified next parameter; the OAuth flow is completed
The fix
The OAuth flow should use a fixed, pre-registered redirect URI that cannot be tampered with by the user.
How it was found
- Visit the OAuth authorisation URL with the original 'next' parameter.
- Change the 'next' parameter to a profile path controlled by the attacker.
- Complete the OAuth flow and observe the token being sent to the attacker-controlled profile.
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 Twitter on a website, the site receives a special token that proves who you are. This report shows that the site let the user choose where that token was sent afterwards. By changing a value in the link, an attacker could make the token go to a page they control, stealing it.
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.