Skip to content

QuizNot attempted

CORS is not CSRF protection

"We set a strict CORS policy, so we are safe from CSRF." Why is this wrong?
1–4 to choose, Enter to submit
Show answer & explanation

Correct answer:

  • CORS controls who can READ the response; a CSRF attack only needs the request to be SENT
  • CORS decides whether a cross-origin script may READ the response
  • a CSRF attack only needs the request to be SENT with the cookie, and form posts or <img> GETs go out without any CORS check.
  • Not Chrome-only: every modern browser enforces CORS.
  • Not GET-only: CORS applies to all methods, it just doesn't block simple requests from being sent.
  • Not 'it is right': the state change happens even though evil.com can't read the answer.
  • Use SameSite cookies plus a CSRF token.