鄭蘇寧
關(guān)鍵詞: 跨站請(qǐng)求偽造; 前端JS; 令牌; Web應(yīng)用防火墻
Abstract:CSRF (Cross-Site Request Forgery) is a very popular Web attack method. At present, there are some problems in the universality and effectiveness of the solutions to protect CSRF, which can not achieve good protection effect. Therefore, a CSRF protection design based on JavaScript is proposed. By executing JS (JavaScript) files, the client can add and refresh cookie tokens or URL tokens for POST requests, making the attacker's malicious request unable to refresh the tokens and finally the attack fails. The design can be applied to Web application firewall to defend CSRF attack more effectively.
1 引言
跨站請(qǐng)求偽造[1](Cross-Site Request Forgery,CSRF)攻擊是一種常見(jiàn)的Web攻擊,容易在用戶不知情的情況下進(jìn)行轉(zhuǎn)賬、修改密碼等各種敏感操作,造成巨大的危害。
2 基于前端JS的CSRF防護(hù)設(shè)計(jì)
2.1 CSRF攻擊及防御現(xiàn)狀
CSRF攻擊主要有標(biāo)簽類GET請(qǐng)求、POST請(qǐng)求、鏈接類GET請(qǐng)求三種方式。標(biāo)簽類GET請(qǐng)求攻擊是一種比較簡(jiǎn)單的方式,常常利用惡意網(wǎng)頁(yè)的標(biāo)簽src屬性發(fā)出GET請(qǐng)求,攻擊示例有,