CSRF(跨站请求伪造) 欺骗已登录用户的浏览器对其已认证的网站发送 不需要的请求 — 在用户不知情的情况下执行操作(转账、更改),利用浏览器自动发送凭证/cookies 的特性。
CSRF 如何工作
The attack exploits that browsers AUTO-SEND cookies (incl. session cookies) with requests:
1. a user is LOGGED IN to a site (has a session cookie)
2. the user visits a MALICIOUS page (or clicks a crafted link)
3. that page makes a request to the target site (e.g. a hidden form auto-submitting)
4. the browser AUTOMATICALLY includes the user's session cookie → the site thinks it's
a legitimate request from the user → performs the action (transfer money, change email)
→ the user unknowingly performs an action they didn't intend.
