Cross-Site Request Forgery (CSRF)
A flaw that tricks a logged-in user's browser into performing an unwanted action on a site they trust.
What it is
Cross-Site Request Forgery abuses the fact that a browser automatically sends a user's session information with requests to a site. By luring a logged-in victim to a malicious page, an attacker can cause the victim's browser to perform actions on the trusted site without their knowledge. The user is the unwitting carrier of the attacker's request.
Why it matters
CSRF can cause actions like changing a password or making a transaction to be carried out as the victim, without their consent.
How to fix it
Use anti-CSRF tokens on state-changing requests, set cookies with the SameSite attribute, and require re-authentication for sensitive actions.