鄭蘇寧
關(guān)鍵詞: 跨站請求偽造; 前端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 引言
跨站請求偽造[1](Cross-Site Request Forgery,CSRF)攻擊是一種常見的Web攻擊,容易在用戶不知情的情況下進行轉(zhuǎn)賬、修改密碼等各種敏感操作,造成巨大的危害。
2 基于前端JS的CSRF防護設(shè)計
2.1 CSRF攻擊及防御現(xiàn)狀
CSRF攻擊主要有標(biāo)簽類GET請求、POST請求、鏈接類GET請求三種方式。標(biāo)簽類GET請求攻擊是一種比較簡單的方式,常常利用惡意網(wǎng)頁的標(biāo)簽src屬性發(fā)出GET請求,攻擊示例有,