NEWPractise supported commands in browser simulations, alongside the lesson.Try a browser practice exercise.Try a lab♥ Codelivly is 100% free, no paywall. If it helped you, chip in to keep it running.100% free. Help keep it so.Support us
Preview · 35 min
Check that every state changing request needs the CSRF token, record a missing check on a test account request with clean evidence, and judge its weight.
A browser attaches the session cookie to every request it sends to Ledgerline, whichever page started the request. That convenience is how a user stays signed in across tabs, and it has a side effect. When a page on another site causes the browser to send a request to Ledgerline, the cookie goes along, and the server sees a perfectly valid session. The server cannot tell from the cookie alone whether the user meant to send that request.
Sam Okoro's notes describe the defence: the login response returns a token in the header X-CSRF-Token, and every state changing request must echo it in a request header with the same name. A page on another site cannot read the token, so it cannot add it. On Thursday morning you check that every state changing request you can reach really does require it. Your evidence is the server's answer to plain requests from your own test account. You build no page, no form and no script from another site, and you do not need to.
Create a free account to unlock the rest of this task, complete tasks, and earn Rep.
Sign in