国产日韩欧美一区二区三区三州_亚洲少妇熟女av_久久久久亚洲av国产精品_波多野结衣网站一区二区_亚洲欧美色片在线91_国产亚洲精品精品国产优播av_日本一区二区三区波多野结衣 _久久国产av不卡

?

一種基于前端JS的CSRF防護設(shè)計

2021-09-23 03:54鄭蘇寧
電腦知識與技術(shù) 2021年24期
關(guān)鍵詞:令牌

鄭蘇寧

關(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請求,攻擊示例有,