Skip to content
Sharp

Authentication · interview question

How would you explain a common method to prevent Cross-Site Request Forgery (CSRF) attacks in web applications in an interview?

Multiple choiceEasychapter-17-curatedpremiumauthenticationplaintext-passwords
Choose one answer
Answer and explanation

Correct answer

B. Including a CSRF token in HTTP requests.

Why

Including a CSRF token in HTTP requests allows the server to verify that the request is coming from a legitimate source, mitigating potential CSRF attacks.

Test yourself on Authentication

A free test with instant, explained results. No account needed.

Start free test
All Authentication questions →