312-50V10 · Question #271
Which of the following conditions must be given to allow a tester to exploit a Cross-Site Request Forgery (CSRF) vulnerable web application?
The correct answer is D. The web application should not use random tokens.. CSRF attacks succeed when the application lacks unpredictable anti-CSRF tokens, allowing forged requests to be accepted as legitimate. Browser version is irrelevant to this vulnerability class.
Question
Which of the following conditions must be given to allow a tester to exploit a Cross-Site Request Forgery (CSRF) vulnerable web application?
Options
- AThe victim user must open the malicious link with an Internet Explorer prior to version 8.
- BThe session cookies generated by the application do not have the HttpOnly flag set.
- CThe victim user must open the malicious link with a Firefox prior to version 3.
- DThe web application should not use random tokens.
How the community answered
(26 responses)- A12% (3)
- B4% (1)
- C8% (2)
- D77% (20)
Why each option
CSRF attacks succeed when the application lacks unpredictable anti-CSRF tokens, allowing forged requests to be accepted as legitimate. Browser version is irrelevant to this vulnerability class.
CSRF exploitation is not limited to Internet Explorer prior to version 8 - all browsers will automatically attach session cookies to cross-origin requests unless same-site cookie policies are enforced.
The HttpOnly flag prevents client-side JavaScript from reading cookies, but CSRF does not require reading the cookie - the browser automatically sends it with the forged request regardless of the HttpOnly flag.
CSRF is not dependent on Firefox version - the attack relies on browser cookie-handling behavior that is consistent across modern browsers and versions.
The fundamental defense against CSRF is the use of a random, unpredictable synchronizer token tied to the user's session. Without this token, the server cannot distinguish a legitimate user-initiated request from a forged one crafted by an attacker. When the application omits random tokens, any cross-origin request carrying the victim's session cookie will be accepted.
Concept tested: Anti-CSRF token requirement for CSRF prevention
Source: https://owasp.org/www-community/attacks/csrf
Topics
Community Discussion
No community discussion yet for this question.