Skip to content
CSRF Write-up Beginner

Token Tampering leads to change the user details

A profile settings request accepted a CSRF token that belonged to a different account, so the token was not tied to the user session. An attacker could use their own token to change another user's details without knowing that user.

levi4 Follow

Published on levi4.medium.com

Get connected in the linkedIn for updates

Levi Ackerman, on levi4.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 server validated the CSRF token's format or existence but did not bind it to the session or user it was issued for.

Impact

An attacker could change another user's profile details without knowing that user, though the text does not show a full cross-site attack.

What the attacker needed

Two accounts on the site; ability to intercept requests

The fix

The server should tie each CSRF token to the session or user it was issued for and reject tokens from other accounts.

How it was found

  1. Intercept the profile settings request.
  2. Copy the CSRF token from that request.
  3. Create a second account and copy its CSRF token.
  4. Replace the first account's token with the second account's token and send the request.

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 random value a site puts in forms to prove a request came from its own pages and not from another site. Here the site checked that some valid token was present but did not check it belonged to the logged-in user, so a token from one account worked for another. That lets someone change another person's profile details.

What is CSRF?

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

More by levi4

View all

1 more disclosed report, 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.