Cross-Site Request Forgery (CSRF)
Cross-Site Request Forgery (CSRF) is a web security vulnerability that forces a user's browser to perform unwanted actions on a web application in which they are authenticated. CSRF attacks exploit the trust that web applications have for authenticated users and can result in unauthorized data modi…
CompTIA Security+ - Cross-Site Request Forgery (CSRF) Example Questions
Test your knowledge of Cross-Site Request Forgery (CSRF)
Question 1
A company has implemented a password reset form that includes a secret question and answer as part of the process. An attacker can reset a victim's password by submitting a CSRF attack with a forged password reset request. What method can the developer use to prevent this attack?
Question 2
An e-commerce website allows users to view their order history. After logging in, a user can access the order history page by clicking the "viewOrder?id=xxx" link. An attacker sends a victim an email with an image element pointing to the "viewOrder?id=yyy" URL. How can the developer mitigate this potential CSRF attack?
Question 3
A social media website's "like" feature uses a link in the following format: "like.php?post_id=123456". An attacker sends a link to the victim's email with the same URL format to trick the user into liking a malicious post. What measure can the developer implement to prevent abuse of this "like" feature?