Skip to content
Open redirect Disclosed report Beginner

Open Redirect Protection Bypass

The open redirect protection added for a previous report could be bypassed by supplying a callback URL that begins with two slashes, causing the victim to be redirected to an attacker-chosen domain after authorising a team. An attacker could use this to send victims to a phishing or malicious site under the trusted twitter.com link.

avinash_ Follow

Originally disclosed on HackerOne

Bounty$280 View original
  • Triaged in 11 days
  • Fixed in 20 days
  • Paid in 55 days
  • Disclosed after 57 days

Hi

Report #281538 is fixed but Attacker can Bypass this Open Redirect Protection.

Give this link https://twitter.com/teams/authorize?target_screen_name=&authorize_callback=//www.facebook.com to authorized victim.Twitter will say him to authorize a different account for create team.After authorization victim will be redirected to www.facebook.com

Vulnerable point //www.facebook.com (You can use //www.example.com )

Open Redirection Protection Bypassed.

PoC video attached

With Best Regards

Attachments

PoC_Friday_27_October_2017_02_09_34__IST.mp4 From the original on HackerOne

The original report as published on HackerOne, by avinash_. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 4 min read.

What the report shows

The target is the Twitter teams feature. The researcher reports that an earlier open redirect fix, referenced as report #281538, can be bypassed. The feature in question is the team authorisation flow at /teams/authorize, which takes a target_screen_name parameter and an authorize_callback parameter.

The researcher's steps were:

  1. Build a link to the team authorisation endpoint with an empty target_screen_name and an authorize_callback value pointing at another site.
  2. Send that link to an authorised victim.
  3. The victim is asked to authorise a different account in order to create a team.
  4. After authorisation, the victim is redirected to the attacker-chosen site.

The link given in the report is:

Text
https://twitter.com/teams/authorize?target_screen_name=&authorize_callback=//www.facebook.com

The researcher identifies the vulnerable value as //www.facebook.com and notes that //www.example.com can be used instead. The report states plainly that the open redirection protection was bypassed. A proof-of-concept video is attached.

PoC_Friday_27_October_2017_02_09_34__IST.mp4 From the original on HackerOne

A proof-of-concept video is attached. The report does not give a severity rating or a CVSS score. The platform records a bounty of 280.00 USD and a disclosure date of 2017-12-23. The report itself does not describe a fix.

Root cause

The likely cause is that the redirect protection validates the authorize_callback value against a rule that a protocol-relative URL slips past. A value beginning with // is treated by browsers as a reference to the current scheme with a different host, so //www.facebook.com resolves to https://www.facebook.com when the page is served over HTTPS. If the check only looks for an absolute URL with an explicit scheme, or only compares against an allowlist in a way that does not normalise //host forms, the value passes validation and is then used as the redirect destination. The report does not state what the check actually did, so the exact validation mistake is inferred from the bypass value alone.

Impact

The consequence described is that a victim who is asked to authorise an account for team creation ends up on an attacker-controlled site after authorising. Because the link is on the trusted twitter.com domain, it lends credibility to a phishing flow: the victim sees a genuine authorisation prompt and is then moved to a page the attacker chose.

How this kind of bug works

An open redirect exists when an application takes a destination from user input and sends the browser there without restricting it to trusted targets. The bug class matters most when the redirect happens on a domain users trust, because the first hop is legitimate and only the second hop is attacker-controlled.

Bypasses of an existing protection usually exploit a gap between how the validator parses a URL and how the browser does. Common shapes include protocol-relative values (//host), values with userinfo (https://[redacted]), backslash variants, encoded characters, and hosts that merely contain the trusted string as a prefix or suffix. The validator may see a relative path or a trusted-looking host while the browser resolves a different origin. The defence is to avoid free-form destinations altogether: use an allowlist of relative paths or opaque identifiers mapped server-side to destinations, and reject anything that is not on it after normalisation.

How to test for it

  1. Find parameters that carry a destination: callback, return, next, redirect, continue, target, url, and similar names, especially in login, logout, authorisation and OAuth-style flows.
  2. Send a benign external value first to confirm the parameter is reflected into a redirect at all.
  3. If the value is rejected, probe the parser gap: protocol-relative forms, a trusted host in the userinfo position, a trusted host as a prefix or suffix of an attacker host, mixed case, and encoded variants of each.
  4. Watch the actual Location header and the browser's final address, not just the response body. A positive result is a response that sends the browser to a host you control, or a page that navigates there after a user action such as authorisation.
  5. Common false positives: a redirect that only fires for the same origin, a value that is echoed into the page but never used for navigation, a redirect that requires an already-authenticated session you cannot obtain, and client-side navigation that is blocked by the browser. Confirm the final destination in a real browser before reporting.

How it is fixed

The standard fix is to stop accepting arbitrary destinations. Replace the free-form parameter with an identifier that the server maps to a known destination, or validate against a strict allowlist of relative paths. If external destinations are genuinely required, parse the value with a URL parser, require an explicit scheme and host, compare the normalised host against an allowlist, and reject protocol-relative and userinfo forms. Redirect only after the check passes, and keep the validation on the server rather than in client-side code.

Hunting notes

Redirect parameters cluster in authentication and account flows: login and logout, password reset, invitation and team authorisation, OAuth consent, and any feature that returns the user somewhere after an action. Recon signals include parameters whose names suggest a destination, endpoints that issue a Location header, and features that were recently patched, since a fix for one bypass shape often leaves others open. To make a report land, show the full flow from a trusted link to the attacker destination, demonstrate the final address in a browser, and keep the payload minimal. Where the redirect follows a user action such as authorisation, record that step so the reviewer can see the victim's experience.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 7 min read.

What happened, in plain words

Twitter has a feature called Teams, where an account is authorised in order to create a team. This approval step is the part of the product the report is about.

An earlier open redirect problem in this flow had already been fixed, referenced as report #281538. That is called an open redirect: the site takes a destination from the link and sends the browser there, even when the destination is not part of the site. Twitter fixed that earlier problem, which the report refers to as report #281538.

The researcher in this report found that the fix could be worked around. The protection was still there, but a slightly different kind of destination value slipped past it. The report calls this a bypass of the open redirect protection.

The link used in the report is:

Text
https://twitter.com/teams/authorize?target_screen_name=&authorize_callback=//www.facebook.com

Reading it piece by piece:

  • https://twitter.com/teams/authorize is the genuine Twitter page that handles team approval. Because it sits on twitter.com, a victim has every reason to trust it.
  • ? starts the query string, the part of a link that carries settings for the page.
  • target_screen_name= is a setting that names the account involved. Here it is left empty.
  • & separates one setting from the next.
  • authorize_callback=//www.facebook.com is the setting that tells Twitter where to send the person after they approve. Its value is //www.facebook.com.

The researcher's steps were:

  1. Build the link above, with an empty target_screen_name and an authorize_callback pointing at another site.
  2. Send that link to a victim who is allowed to authorise accounts.
  3. The victim is asked to authorise a different account in order to create a team.
  4. After authorising, the victim is sent to the site named in the link.

The researcher names //www.facebook.com as the vulnerable value and notes that //www.example.com works just as well. The report states plainly that the open redirection protection was bypassed. A proof-of-concept video is attached.

PoC_Friday_27_October_2017_02_09_34__IST.mp4 From the original on HackerOne

Why does //www.facebook.com matter? In a web address, a value that starts with two slashes and no scheme is read by the browser as "same kind of connection as the current page, but a different website". So when the approval page is served over HTTPS, //www.facebook.com becomes https://www.facebook.com. The protection probably checked the destination in a way that did not account for this short form, so the value was accepted and then used as the place to send the victim. The report does not say what the check actually did, so the exact mistake is inferred from the value that got through.

The report gives no severity rating and no CVSS score. The platform records a bounty of 280.00 USD and a disclosure date of 2017-12-23. The report does not describe a fix.

In general, how this kind of bug works

An open redirect happens when a website takes a destination from the link a visitor clicked and sends the browser there without checking that the destination is trusted. The danger is greatest on a domain people trust, because the first step is real: the victim really is on twitter.com, sees a real approval prompt, and only the second step, the jump away, is controlled by the attacker. That makes a convincing setup for phishing, where someone is led to a fake page that asks for a password or other details. This report does not describe any such follow-up, so the impact here is simply being sent to an arbitrary site through a trusted link.

When a site already blocks obvious bad destinations, attackers look for a gap between how the site's check reads a value and how the browser reads it. Common shapes include:

  • protocol-relative values such as //host, which borrow the current scheme;
  • a trusted name placed before an @ sign, as in https://[redacted], where the browser goes to the part after the @;
  • backslash variants and encoded characters;
  • attacker hosts that merely contain a trusted name as a prefix or suffix.

The check may see a harmless path while the browser resolves a different site. The defence is to stop accepting free-form destinations: use a fixed list of allowed paths, or an identifier that the server maps to a known destination, and reject anything not on that list after normalising it.

How to test for it

  1. Look for settings that carry a destination: names like callback, return, next, redirect, continue, target and url, especially in login, logout, approval and OAuth-style flows.
  2. Send a harmless external value first, to confirm the setting is used for a redirect at all.
  3. If the value is rejected, try the parser gap: protocol-relative forms, a trusted name in the @ position, a trusted name as a prefix or suffix of an attacker host, mixed case, and encoded variants.
  4. Watch the actual Location header and the browser's final address, not just the page body. A positive result is a response that sends the browser to a host you control, or a page that navigates there after a user action such as approval.
  5. Common false positives: a redirect that only fires within the same site, a value shown on the page but never used for navigation, a redirect that needs a logged-in session you cannot get, and client-side navigation the browser blocks. Confirm the final destination in a real browser before reporting.

How it is fixed

The standard fix is to stop accepting arbitrary destinations. Replace the free-form setting with an identifier the server maps to a known destination, or check against a strict list of allowed paths. If external destinations are genuinely needed, parse the value with a URL parser, require an explicit scheme and host, compare the normalised host against an allowed list, and reject protocol-relative and @ forms. Redirect only after the check passes, and keep the check on the server rather than in client-side code.

Hunting notes

Redirect settings cluster in account and authentication flows: login and logout, password reset, invitations and team approval, OAuth consent, and any feature that returns the user somewhere after an action. Useful signals include setting names that suggest a destination, endpoints that send a Location header, and features that were recently patched, since a fix for one bypass shape often leaves others open. To make a report land, show the full flow from a trusted link to the attacker destination, demonstrate the final address in a browser, and keep the payload minimal. Where the redirect follows a user action such as approval, record that step so the reviewer can see the victim's experience.

Glossary

  • Open redirect: a flaw where a site takes a destination from user input and sends the browser there without restricting it to trusted targets.
  • Bypass: a way of getting past a protection that is already in place.
  • Teams: the Twitter feature that lets accounts group together, with an approval step for invited accounts.
  • Authorise: to approve an action, here joining or creating a team.
  • Endpoint: a specific address on a site that handles a particular action, such as /teams/authorize.
  • Parameter: a named setting in a link, such as authorize_callback, that the page reads.
  • Query string: the part of a link after ?, carrying parameters separated by &.
  • Callback: a destination a site sends the user to after an action completes.
  • Protocol-relative URL: a value starting with // that borrows the current page's scheme, so //www.facebook.com becomes https://www.facebook.com on an HTTPS page.
  • Scheme: the first part of a web address, such as https or http, that says how to connect.
  • Host: the website name in an address, such as www.facebook.com.
  • Origin: the combination of scheme, host and port that a browser treats as one site.
  • Redirect: a response that tells the browser to load a different address.
  • Location header: the part of a redirect response that names where the browser should go next.
  • Allowlist: a fixed list of values that are permitted, with everything else rejected.
  • Normalisation: rewriting a value into a standard form before comparing it, so different spellings of the same thing match.
  • Userinfo: the optional name before an @ sign in an address, which browsers ignore when deciding where to connect.
  • Phishing: tricking someone into trusting a page so they hand over information or take an unsafe action.
  • Proof of concept (PoC): a demonstration, often a video or script, that shows a flaw actually working.
  • CVSS: a standard scoring system for the severity of a security flaw.
  • Bounty: a payment a company makes to someone who reports a valid security flaw.

More by avinash_

View all

6 more disclosed reports, best first.

More from X / xAI

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Open redirect

The lesson behind this report.

A trusted site forwards users to any address an attacker picks; rarely paid alone, often the missing link in a chain.