注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

Tetraph 的博客

IT 计算机网络信息安全技术 数学 统计 云计算 安全漏洞 日常随笔 散文 音乐

 
 
 

日志

 
 

Sina Weibo OAuth 2.0 Covert Redirect Vulnerability (Information Leakage & Open Redirect) 新浪 微博 漏洞  

2014-05-06 13:44:38|  分类: OAuth2.0 漏洞 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

Covert Redirect: http://tetraph.com/covert_redirect/


Covert Redirect Related to OAuth 2.0 and OpenID:

http://tetraph.com/covert_redirect/oauth2_openid_covert_redirect.html



Weibo's OAuth 2.0 system is susceptible to Attacks. More specifically, the authentication of parameter "&redirct_uri" in OAuth 2.0 system is insufficient. It can be misused to design Open Redirect Attacks to Weibo.


At the same time, it can be used to collect sensitive information of both third-party app and users by using the following parameters (sensitive information is contained in HTTP header.),

"&response_type"=sensitive_info,token...

"&scope"=get_user_info%2Cadd_share...


It increases the likelihood of successful Open Redirect Attacks to third-party websites, too.



The vulnerabilities occurs at page "oauth2/authorize?" with parameter "&redirect_uri", e.g.

https://api.weibo.com/oauth2/authorize?client_id=2021435350&redirect_uri=http%3A%2F%2Fuc.cjcp.com.cn%2Findex.php%3Fm%3DUser%26a%3Dcallback%26type%3Dsina&response_type=code [1]



Before acceptance of third-party application:

When a logged-in Weibo user clicks the URL ([1]) above, he/she will be asked for consent as in whether to allow a third-party website to receive his/her information. If the user clicks OK, he/she will be then redirected to the URL assigned to the parameter "&redirect_uri".


If a user has not logged onto Weibo and clicks the URL ([1]) above, the same situation will happen upon login.



After acceptance of third-party application:

A logged-in Weibo user would no longer be asked for consent and could be redirected to a webpage controlled by the attacker when he/she clicks the URL ([1]).


For a user who has not logged in, the attack could still be completed after a pop-up page that prompts him/her to log in.




(1) Weibo would normally allow all the URLs that belong to the domain of an authorized third-party website. However, these URLs could be prone to manipulation. For example, the "&redirect_uri" parameter in the URLs is supposed to be set by the third-party websites, but an attacker could change its value to make Attacks. 


Hence, a user could be redirected from Weibo to a vulnerable URL in that domain first and later be redirected from this vulnerable site to a malicious site unwillingly. This is as if the user is redirected from Weibo directly. The number of Weibo's OAuth 2.0 client websites is so huge that such Attacks could be commonplace.


Before acceptance of the third-party application, Weibo's OAuth 2.0 system makes the redirects appear more trustworthy and could potentially increase the likelihood of successful Open Redirect Attacks of third-party website.


Once the user accepts the application, the attackers could completely bypass Weibo's authentication system and attack more easily.



I used one of my webpages for the following tests. The webpage is "http://tetraph.com/essayjeans/seasons/%E7%A5%AD%E6%98%A5.html". We can suppose it is malicious and contains code that collect sensitive information of both third-party app and users.


Below is an example of a vulnerable third-party domain:

cjcp.com.cn


Vulnerable URL in this domain:

http://uc.cjcp.com.cn/?m=user&a=otherLogin&type=sina&furl=http%3A%2F%2Ftetraph.com%2Fessayjeans%2Fseasons%2F%25E7%25A5%25AD%25E6%2598%25A5.html


Vulnerable URL from Weibo that is related to cjcp.com.cn:

https://api.weibo.com/oauth2/authorize?client_id=2021435350&redirect_uri=http%3A%2F%2Fuc.cjcp.com.cn%2Findex.php%3Fm%3DUser%26a%3Dcallback%26type%3Dsina&response_type=code


POC:

https://api.weibo.com/oauth2/authorize?client_id=2021435350&redirect_uri=http%3A%2F%2Fuc.cjcp.com.cn%2F%3Fm%3Duser%26a%3DotherLogin%26type%3Dsina%26furl%3Dhttp%253A%252F%252Ftetraph.com%252Fessayjeans%252Fseasons%252F%2525E7%2525A5%2525AD%2525E6%252598%2525A5.html&response_type=code [2]





(2) Another method for attackers.


Attackers enter the following URL in browser,

http://uc.cjcp.com.cn/?m=user&a=otherLogin&type=sina&furl=http%3A%2F%2Ftetraph.com%2Fessayjeans%2Fseasons%2F%25E7%25A5%25AD%25E6%2598%25A5.html


Then, attackers can get URL below,

https://api.weibo.com/oauth2/authorize?client_id=2021435350&redirect_uri=http%3A%2F%2Fuc.cjcp.com.cn%2Findex.php%3Fm%3DUser%26a%3Dcallback%26type%3Dsina&response_type=code [3]


If users click URL [3], the same thing will happen as URL [2].


My tests were performed on Firefox (26.0) in Ubuntu (12.04) and IE (9.0.15) in Windows 7.









  评论这张
 
阅读(62)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017