Skills101
← All practice quizzes

Quiz: CSRF and CORS

5 questionsNo time limitPass: 60%+10 XP on first pass

How a malicious page can make a logged-in user's browser perform actions on your site (CSRF), the defences (SameSite cookies, CSRF tokens, origin checks), and the most misunderstood header in web development — CORS.

Log in to take the quiz

Free account · see your score, answers and explanations, earn XP

  1. Question 1

    In a CSRF attack, what does the attacker rely on?

  2. Question 2

    Which statement about CORS is true?

  3. Question 3

    Why is SameSite=Lax effective against CSRF?

  4. Question 4

    Why does the CSRF demo use hmac.compare_digest instead of ==?

  5. Question 5

    What does cors_headers_good return for https://evil.example?