A browser attaches cookies to requests, not intentions. Ask whether a state-changing endpoint can distinguish a real user action from a forged one.
Cookies are ambient authority: the browser sends them automatically to the cookie's host. If a state-changing endpoint relies only on that cookie, another site can cause the request without reading the response. The server authenticates the browser, not the human.
- Inspect the account action endpoint
- Build a cross-site request on the attacker origin
- Report the attacker URL to the victim bot
- Capture the flag
Browser cookie to server session
Where to look before you type a payload
The victim is signed in and the browser holds a session cookie for the target site.
The attacker hosts a page, image, form or navigation that targets the victim site.
The browser attaches cookies according to host and SameSite rules; the attacker does not need to read them.
The endpoint accepts the request without proving user intent, so the server performs the action.
Open one hint at a time. The first two build the model; the last two point at the boundary.
Hint 1
Find the account action that changes state.
Hint 2
Notice whether the endpoint uses GET and only a session cookie.
Hint 3
The action is a GET and SameSite=Lax still sends the cookie on top-level navigation. Report the attacker URL with endpoint=/account/change-email, email=attacker@evil.test.
Hint 4 · near the answer
Report the attacker URL with the endpoint, parameter and target value.
Observe → Hypothesize → Test → Prove → Explain
This is the same loop a reviewer expects in a report. Your draft stays in this browser; nothing is submitted until you choose to export it.
Evidence log
Write for a reviewer who was not in the room. Every claim needs a request, response or state change behind it.
Preview the evidence report
# Lab evidence report — Email Change Without a Token - Family: Cross-Site Request Forgery - Lab ID: web-csrf-email - Date: 2026-12-05 ## Workflow ### Observe - [ ] Open "Email Change Without a Token" and record /account/change-email, the HTTP method and the role you are given. - [ ] List every parameter, header, cookie and object identifier the normal flow exposes. - [ ] Save a baseline response: status, body shape, timing and the fields that change by user. ### Hypothesize - [ ] Name the server decision that protects /account/change-email, and the evidence it should use. - [ ] Use the clue as a constraint, not an answer: Report the attacker URL with endpoint=/account/change-email, param=email and value=attacker@evil.test. The bot's navigation carries the Lax cookie. - [ ] Predict the exact status, body or state change that would prove the decision is missing. ### Test - [ ] Start from the baseline and change one value: the /account/change-email GET action. - [ ] Keep the request replayable; vary encoding, method or identifier location only after the first result. - [ ] Capture the full request and response for the winning attempt, including the flag. ### Prove - [ ] Capture the flag and name the exact foreign object, role or state change it proves. - [ ] Repeat from a clean session and confirm the result is not cached or stale. - [ ] State impact precisely: what data or action did you actually obtain? ### Explain - [ ] State the root cause without naming the payload: which decision failed? - [ ] Name the control that prevents recurrence and the layer where it belongs. - [ ] Write one regression test that fails before the fix and passes after it. ## Evidence ### Target and baseline _Not recorded._ ### Hypothesis _Not recorded._ ### Winning request _Not recorded._ ### Proof _Not recorded._ ### Root cause _Not recorded._ ### Control and regression test _Not recorded._ ## Analyst conclusion The proof demonstrates the missing control above. The regression test should fail against the vulnerable behavior and pass after remediation.
The full request, the reasoning and the debrief unlock after a successful capture. That is deliberate: struggle first, then consolidate.
False positives to rule out
- The endpoint returns 403 to a cross-site form: verify whether the token is actually validated or only present.
- The UI hides the action: the endpoint may still accept a direct request.
- SameSite=Strict blocks the request in one browser: test top-level GET, older clients and alternate flows.
Regression tests to name
- Cross-site GET: The request is rejected or the method is not allowed
- Missing token: The server rejects it before the update
- Wrong origin: The server rejects the request
- Use non-idempotent methods and a per-session, unpredictable synchronizer token.
- Validate Origin and Fetch Metadata on state-changing requests.
- Set session cookies SameSite=Lax or Strict and never use GET for state changes.
- Require re-authentication for high-impact actions.
CSRF ليست سرقة جلسة، بل استغلال ثقة المتصفح: الكوكي تُرسل تلقائيًا. الحل ليس إخفاء النموذج، بل رمز مزامنة غير قابل للتخمين، وفحص المصدر، ومنع تغيير الحالة عبر GET.