Multiple choice technology security

Prevention from CSRF is

  1. Only accepting POST requests

  2. Using a secret cookie

  3. Both

  4. None of the above

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Accepting only POST requests is not effective CSRF prevention because CSRF can trigger POST requests via HTML forms. Secret cookies alone don't prevent CSRF because the browser automatically sends cookies with requests. Effective CSRF prevention requires Anti-CSRF tokens (unique, unpredictable, validated by server) or SameSite cookie attributes (restrict cookie cross-site behavior).