Overview - Cross-site request forgery (CSRF)
What is it?
Cross-site request forgery (CSRF) is a type of cyber attack where a malicious website tricks a user's browser into performing unwanted actions on a different website where the user is logged in. It exploits the trust that a website has in the user's browser by sending unauthorized commands without the user's knowledge. This can lead to actions like changing account details or making transactions without permission. CSRF attacks rely on the victim being authenticated on the target site.
Why it matters
CSRF attacks can cause serious harm by making users unknowingly perform harmful actions, such as transferring money or changing passwords. Without protections against CSRF, websites would be vulnerable to attackers who can hijack user sessions and cause damage without needing to steal passwords. This undermines trust in online services and can lead to financial loss, privacy breaches, and damaged reputations.
Where it fits
Before learning about CSRF, one should understand how web sessions and cookies work, especially how browsers store and send authentication tokens. After CSRF, learners can explore related web security topics like Cross-Origin Resource Sharing (CORS), SameSite cookies, and other web attack types such as Cross-site scripting (XSS).