Defending against CSRF and XSS
1.[3p] The same-origin policy is in force and a page on evil.com posts a form to bank.com. Why does the request still succeed?
The same-origin policy is in force and a page on evil.com posts a form to bank.com. Why does the request still succeed?
2.[3p] Which cross-site requests reach the server with no CORS preflight, so the cookie is attached?
Which cross-site requests reach the server with no CORS preflight, so the cookie is attached?
Select all that apply
3.[3p] A site sets SameSite=Lax and has GET /account/delete?confirm=yes. Is it protected?
A site sets SameSite=Lax and has GET /account/delete?confirm=yes. Is it protected?
4.[3p] Naive double submit is broken by an attacker who controls any subdomain. What do they do?
Naive double submit is broken by an attacker who controls any subdomain. What do they do?
5.[3p] Match each kind of cross-site scripting to where the payload comes from.
Match each kind of cross-site scripting to where the payload comes from.
Reflected
Stored
DOM-based
read from the URL by page script and written into the document
echoed straight back in the response to the request that carried it
saved in the database and served to every later visitor
Show the answer
Reflected: echoed straight back in the response to the request that carried it Stored: saved in the database and served to every later visitor DOM-based: read from the URL by page script and written into the document
6.[2p] HttpOnly prevents an attacker with cross-site scripting on your origin from acting as the logged-in user.
HttpOnly prevents an attacker with cross-site scripting on your origin from acting as the logged-in user.
7.[3p] Why is sanitising input on the way into the database the wrong layer?
Why is sanitising input on the way into the database the wrong layer?
8.[3p] Which of these belong in a modern Content Security Policy?
Which of these belong in a modern Content Security Policy?
Select all that apply
9.[2p] Which request header, set by the browser and unforgeable by script, is the cheapest second layer against CSRF?
Which request header, set by the browser and unforgeable by script, is the cheapest second layer against CSRF?