Skip to content
CSRF Write-up Beginner

Finding CSRF Bug Bounty Program — Get $$

A profile update request was accepted without any CSRF or verification token, so a page hosted elsewhere could submit the change on a logged-in victim's behalf. An attacker could change the victim's account name by getting them to load a crafted HTML page and click a submit button.

medium.com

Published on medium.com

Hello everyone, it’s me again XD. in this write-up, i’d like to share a little story and some of my experience during a bug hunting session on a company that runs a bug bounty program. during my testing, i discovered a CSRF vulnerability.

Firdaus Muhammad Ismail, 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 profile update endpoint relied only on the session cookie for authentication and never checked a per-request anti-CSRF token.

Impact

An attacker could change a logged-in victim's profile name without their consent, though the write-up only demonstrates this single field.

What the attacker needed

Victim is logged in; victim opens attacker's HTML page; victim clicks the submit button

The fix

The endpoint should require a per-request anti-CSRF token (or an equivalent check such as SameSite cookies plus origin validation) before accepting profile changes; the report says the issue was fixed.

How it was found

  1. Change the name on the attacker's own account and intercept the profile update request in a proxy.
  2. Inspect the captured request and note that no CSRF or verification token is present and the body is HTML-encoded rather than JSON.
  3. Use the proxy's engagement tools to generate a CSRF proof-of-concept script from that request.
  4. Save the generated script into an HTML file.
  5. While logged in as the victim in another tab, open the HTML file and click the submit button.
  6. Observe that the victim's account name has been changed.

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.

When you are logged in, your browser automatically sends your session cookie with every request to the site. If the site does not also demand a secret, one-time value (a CSRF token) that only its own pages know, another website can quietly make your browser send a change request that looks legitimate. Here the profile update form had no such secret, so a page the attacker controls could rename the victim's account.

What is CSRF?

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

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.