Skip to content
CSRF Write-up Beginner

How I Was Able To Takeover User Accounts Via Csrf On An E Commerce Website

The profile update endpoint lacked CSRF protection, allowing an attacker to change a victim's email address via a forged request. The attacker then used the password reset flow to take over the account.

Crisdeo Nuel Siahaan Follow

Published on infosecwriteups.com

In this article, We’ll talk about the topic of cross-site request forgery (CSRF) vulnerabilities and I’ll share my personal experience of successfully executing a one-click account takeover on an e-commerce website. This serves as a reminder of the critical role that proper security measures play in keeping our…

Crisdeo Nuel Siahaan, on infosecwriteups.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Impact

An attacker could take over a victim's account by changing their email and then resetting the password, but the attack required the victim to visit a malicious page.

What the attacker needed

Victim logged in; victim visits malicious page

The fix

The vulnerability was fixed by adding CSRF protection to the profile update endpoint.

How it was found

  1. Create a dummy victim account and log in.
  2. Capture the profile update request in Burp Suite and note it lacks CSRF protection.
  3. Craft an HTML page with a form that auto-submits the profile update with attacker-controlled email.
  4. Open the page in the victim's browser to trigger the request.
  5. Verify the victim's profile is updated with the attacker's email.
  6. Use the forgot password flow with the new email to reset the password and take over the account.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

CSRF is when a malicious site tricks your browser into sending a request to another site where you're logged in. Here, the profile update form had no secret token to prove the request came from the real site, so an attacker could change your email. Then they used 'forgot password' to reset your password and take over your account.

What is CSRF?

Another site makes a signed-in user's browser perform an action they did not intend.

More by Crisdeo Nuel Siahaan

View all

2 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site request forgery (CSRF)

The lesson behind this report.

Another site makes a signed-in user's browser perform an action they did not intend.