nerdexam
EC-Council

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.

Hacking Web Applications

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)
  • A
    12% (3)
  • B
    4% (1)
  • C
    8% (2)
  • D
    77% (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.

AThe victim user must open the malicious link with an Internet Explorer prior to version 8.

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.

BThe session cookies generated by the application do not have the HttpOnly flag set.

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.

CThe victim user must open the malicious link with a Firefox prior to version 3.

CSRF is not dependent on Firefox version - the attack relies on browser cookie-handling behavior that is consistent across modern browsers and versions.

DThe web application should not use random tokens.Correct

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

#CSRF#anti-CSRF tokens#web application security#session management

Community Discussion

No community discussion yet for this question.

Full 312-50V10 Practice