CSRF tokens prevent unauthorized commands from being executed on behalf of users.
Cross-Site Request Forgery (CSRF) attacks trick a user into executing unwanted actions on a web application where they are authenticated. A CSRF token, which is unique per session and request, ensures that commands come from legitimate user actions. Without it, an attacker could manipulate a logged-in user's session to perform malicious actions.
Additional Notes
Why are CSRF tokens important in web applications?