Cross-Site Request Forgery (CSRF) | Computer Security
Using cookies and session tokens to keep a user logged in has some associated security risks. In a cross-site request forgery (CSRF) attack, the attacker forces the victim to make an unintended request. The victim’s browser will automatically attach the session token cookie to the unintended request, and the server will accept the request as coming from the victim. For example, suppose a website has an endpoint http://example.com/logout. To log out, a user makes a GET request to this URL with the appropriate session token attached, and the server checks the session token and performs the logout. If an attacker can trick a victim into clicking this link, the victim will be logged out of the website without their knowledge. CSRF attacks can also be executed on URLs with more malicious actions. For example, a GET request to https://bank.com/transfer?amount=100&recipient=mallory with a valid session token might send $100 to Mallory. An attacker could send an email to the victim with the fo
Cross-Site Request Forgery (CSRF) | Computer Security Skip to main content Menu Expand (external link) Document Search Copy Copied Computer Security 21. Cross-Site Request Forgery (CSRF) 21.1. CSRF Attacks Using cookies and session tokens to keep a user logged in has some associated security risks. In a cross-site request forgery (CSRF) attack, the attacker forces the victim to make an unintended request. The victim’s browser will automatically attach the session token cookie to the unintended request, and the server will accept the request as coming from the victim. For example, suppose a web
saved by
related reading
- Cross-Site Scripting (XSS) | Computer Securitytextbook.cs161.org
- Denial-of-Service (DoS) | Computer Securitytextbook.cs161.org
- Same-Origin Policytextbook.cs161.org
- Intrusion Detection | Computer Securitytextbook.cs161.org
- Firewalls | Computer Securitytextbook.cs161.org
- Malware | Computer Securitytextbook.cs161.org
- Anonymity and Tor | Computer Securitytextbook.cs161.org
- TLS | Computer Securitytextbook.cs161.org
- Mitigating Memory-Safety Vulnerabilities | Computer Securitytextbook.cs161.org
- Understanding The Web Security Model, Part IV: Cross-Origin Resource Sharing (CORS)educatedguesswork.org
- What is CORS? Complete Tutorial on Cross-Origin Resource Sharingauth0.com
- Understanding The Web Security Model, Part III: Basic Principles and the Origin Concepteducatedguesswork.org