Authorization disclaimer. This walkthrough is limited to the intentionally vulnerable PortSwigger Web Security Academy lab linked below. Test only systems you own or are explicitly authorized to assess.
Overview
The server recognizes valid CSRF tokens but does not bind each token to the session that obtained it. Consequently, a fresh token taken from the attacker’s own account is accepted when the victim’s browser submits it alongside the victim’s authenticated session cookie.

Lab objective/setup
This intentionally vulnerable Academy exercise isolates csrf where token is not tied to user session. The supplied accounts and endpoints are used to reproduce only the source note evidence for csrf where token is not tied to user session; all request changes remain inside this Academy instance.
What I observed
The account page renders a csrf value for the currently logged-in attacker. The decisive observation is not merely that the token has valid syntax: replaying that attacker-issued token in a request authenticated as the victim is accepted. The application checks membership in a global pool of valid tokens rather than ownership by the current session.

Why it is vulnerable
Token validity is global rather than session-specific. Because the server never verifies that the submitted token was issued to the session cookie authorizing the request, the attacker’s token remains valid when paired with the victim’s login state.
Walkthrough in the authorized PortSwigger lab
- Sign in to the attacker-controlled account and open
/my-accountto obtain a fresh validcsrfvalue from the email-change form. - Build an exploit-server form targeting
POST /my-account/change-email, placing the attacker account’s token in the hiddencsrffield and the required address inemail. - Deliver the auto-submitting form to the victim. Their browser sends the victim’s authenticated session cookie, while the form supplies the valid token obtained from the attacker’s separate session.
- Observe that the request succeeds. This cross-session acceptance is the exact weakness: token validity is checked, but the token is never associated with the user session authorizing the email change.
1 | <html> |


Verification
The final capture shows the Academy marking the csrf where token is not tied to user session exercise as solved after the documented request sequence. No testing was performed outside the isolated lab.

Impact and defensive lesson
The evidence demonstrates the concrete risk of csrf where token is not tied to user session: a server-side trust decision can be bypassed through the exact input or workflow shown in this lab. For csrf where token is not tied to user session, the server must enforce the exact invariant violated in the captured sequence and regression-test that mutation alongside the normal path.