🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: CSRF and CORS: questions with answers

10 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. In a CSRF attack, what does the attacker rely on?
  2. Q2. Which statement about CORS is true?
  3. Q3. Why is SameSite=Lax effective against CSRF?
  4. Q4. Why does the CSRF demo use hmac.comparedigest instead of ==?
  5. Q5. What does corsheadersgood return for https://evil.example?
  6. Q6. Why must GET requests never change data?
  7. Q7. "Our form uses POST, so we are safe from CSRF." Why is this wrong?
  8. Q8. What does the same-origin policy block by default?
  9. Q9. What is the dangerous CORS mistake?
  10. Q10. Which extra step protects critical actions like changing the account email?