Skip to content
CSRF Write-up Beginner

CSRF Enable 2FA allow User Lose Access to Their Account.

The 2FA setup endpoint lacked CSRF protection, so a malicious page could enable 2FA on a victim's account without their knowledge. The victim would then lose access because they never scanned the authenticator barcode or received the backup code.

medium.com

Published on medium.com

I would like to share about a vulnerability that I found recently, a CSRF on the 2FA setup endpoint in a VPS service provider’s web application that allowed users to lose their accounts.

AWesome, 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

Impact

A victim could lose access to their account because 2FA is enabled without them having the authenticator or backup code.

What the attacker needed

Victim is logged in; victim visits a malicious page

How it was found

  1. The tester noticed that 2FA could be enabled by sliding a button without entering a verification code.
  2. The tester checked the backend request and found no CSRF tokens or SameSite cookies.
  3. The tester created a malicious HTML page that sends a POST request to the 2FA settings endpoint with credentials included.
  4. When the victim visited the page, 2FA was enabled on their 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 (Cross-Site Request Forgery) is when a malicious website makes a logged-in user's browser send a request to another site without the user intending to. Here, the 2FA (two-factor authentication) setup could be turned on by such a request, and since the user never set up their authenticator app, they would be locked out of their 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.