Skip to content
CSRF Write-up Intermediate

2 ATO via CSRF by using the same mechanism in different positions

Two CSRF vulnerabilities in a password-setting mechanism allowed an attacker to set a temporary password for any user by knowing their username, and to change the password of a logged-in user without any token. The attacker could take over accounts by tricking a victim into submitting a crafted request.

medium.com

Published on medium.com

Hi again friends, canitey is here, today I’ll share with you a story about 2 account takeover vulnerabilities done by exploiting 2 different CSRFs in the same mechanism. Our story begins with our target its business model is a cloud-based software platform designed for home and commercial service businesses.

CANITEY, 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 application relied on the session cookie for authentication but did not validate a CSRF token or the request origin, and it accepted parameters from the query string even for POST requests, bypassing the JSON content-type check.

What the attacker needed

Victim clicks a link or visits a malicious page; attacker knows the victim's username (first vulnerability); victim is logged in (second vulnerability)

How it was found

  1. Identify that the set temporary password feature uses cookie-based authentication.
  2. Check the session cookie's SameSite flag and find it is set to none.
  3. Try to send the request with a different Content-Type and observe that the endpoint rejects it.
  4. Send a POST request with the required parameters in the query string instead of the JSON body, and see that it works.
  5. For the second vulnerability, log in, change the password, and notice that the request contains no tokens.
  6. Replay the password change request with a new password and confirm the password changes again.

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 (Cross-Site Request Forgery) attack tricks a logged-in user's browser into sending a request to a website the user is already logged into, without the user's knowledge. Here, the website did not properly check that the request came from its own pages, so an attacker could make a victim's browser change passwords. This let the attacker take over accounts.

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.