Cybersecurity glossary
Cross-site request forgery (CSRF)
Cross-site request forgery tricks a signed-in user's browser into sending a request to a site they are signed in to, which the site then carries out as theirs.
A page on another site can submit a hidden form to your bank's transfer address. The browser attaches the bank's cookie, so without a defence the bank cannot tell the request was not meant.
The fixes are a secret token in each form that another site cannot read, SameSite cookies, and checking the Origin header. Never change data on a GET request, which is the easiest to forge.
Learn it hands-on
These free lessons teach it with commands to run in a lab of your own and checked tasks. Read them whole with no account.