nerdexam
EC-Council

312-50V9 · Question #44

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 server cannot distinguish a forged request from a legitimate one, which is only possible when the application does not use unpredictable, session-specific anti-CSRF tokens.

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

(32 responses)
  • A
    13% (4)
  • B
    3% (1)
  • C
    6% (2)
  • D
    78% (25)

Why each option

CSRF attacks succeed when the server cannot distinguish a forged request from a legitimate one, which is only possible when the application does not use unpredictable, session-specific anti-CSRF tokens.

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

CSRF is a browser-agnostic vulnerability that does not depend on the specific version of Internet Explorer, as it exploits how any browser automatically attaches session cookies to cross-origin requests.

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

The HttpOnly flag prevents JavaScript from reading cookies to mitigate XSS-based session theft, but it does not prevent the browser from automatically sending cookies with cross-origin requests, so it does not address CSRF.

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

CSRF exploitability is not tied to Firefox version; it affects all browsers that automatically include credentials with cross-origin requests regardless of vendor or version.

DThe web application should not use random tokens.Correct

Anti-CSRF tokens are the primary defense against CSRF because they require the attacker to know a secret value tied to the user's session, which a forged cross-origin request cannot obtain due to the Same-Origin Policy. Without random tokens, the server has no mechanism to verify that a state-changing request was intentionally submitted by the authenticated user. All major CSRF defenses - synchronizer tokens, double-submit cookies, SameSite cookies - exist specifically to compensate for the absence of this unpredictability.

Concept tested: CSRF vulnerability condition - missing anti-CSRF token

Source: https://owasp.org/www-community/attacks/csrf

Topics

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

Community Discussion

No community discussion yet for this question.

Full 312-50V9 Practice