Skip to content
CSRF Write-up Intermediate

CSRF Bypass Combined with IDOR To Complete Account Takeover!

The email update endpoint used a CSRF token that stayed valid after the request was dropped, and the user_id parameter was guessable, so an attacker could craft a CSRF page that changes a victim's email to one the attacker controls. The attacker could then use the password reset flow to take over the account.

ozomarzu Follow

Published on medium.com

I’ll explain the nature of the website in general. We can consider the website as providing services like shopping, and the nature of the site includes sensitive services.

Omar Alzughaibi, on medium.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

Root cause

Likely the CSRF token was not invalidated after a dropped request and the user_id parameter was not tied to the authenticated session.

Impact

An attacker could change a victim's email address and then reset the password to take over the account.

What the attacker needed

Victim visits attacker's page; attacker has a valid CSRF token; user_id is guessable

How it was found

  1. Send an email update request and capture the CSRF token, then drop the request so the token stays valid.
  2. Build a CSRF page that includes the captured token.
  3. Add a script to the same page that guesses user_id values.
  4. Test the page against a secondary account and change the email address.
  5. Use the password reset page with the new email to 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.

A CSRF token is a secret value a website puts in forms to prove the request came from its own pages, not from an attacker's site. Here the token stayed valid even after the request was abandoned, so an attacker could reuse it in a malicious page. The site also accepted a user_id number that was easy to guess, letting the attacker target other people's accounts.

What is CSRF?

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

More by ozomarzu

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.