CSRF protection
CSRF (cross-site request forgery) is a type of malicious exploit where an attacker gets a user to unknowingly perform an action on a server that they're currently logged in to. This action will change something on the server that is advantageous to the attacker, for example, transfer money, change the password to one the attacker knows, and so on.
For example, an attacker might hide a script in a web page or email and direct the user to it somehow. When it executes, this script could make a POST request to importantwebsite.com/updateEmailAndPassword. If the user is logged in to this site, the request may be successful.
One way to prevent this kind of attack is to embed a special token, essentially a random string, in any form ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access