Skip to content
Account takeover Write-up Intermediate

Bypassing 2FA: How a Flawed SSO Architecture Led to Complete Account Takeover

The SSO API accepted a forged request containing secrets (AES key, digital signature) that were exposed before OTP validation, allowing an attacker to bypass 2FA and gain full access to the victim's dashboard.

pandag0tbann3d Follow

Published on medium.com

It started as a standard assessment. The target was a primary web portal tightly coupled with a secondary dashboard via Single Sign-On (SSO).

Shreyash Mall, 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

The backend exposed the cryptographic secrets needed to build the SSO token immediately after password validation, and the SSO API trusted the client to have completed OTP validation, rather than enforcing a server-side state transition.

Impact

An attacker could bypass two-factor authentication and gain full, unauthorized access to the victim's dashboard.

What the attacker needed

Victim's username and password; ability to intercept traffic

The fix

The SSO token generation should be tied to server-side OTP validation, secrets should not be sent to the client before full authentication, and standard protocols like OAuth 2.0/OIDC should be used instead of custom cryptography.

How it was found

  1. Intercept the traffic during the initial password validation phase.
  2. Observe that the AES key, digital signature, and session identifiers are already present in the proxy history.
  3. Construct the SSO API payload using the exposed secrets and the Base64-encoded credentials.
  4. Drop the intended OTP validation request entirely.
  5. Send the forged request directly to the SSO endpoint.
  6. Receive a valid SSO Auth Token and gain access to the victim's dashboard.

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.

Two-factor authentication (2FA) adds a second step, like a code sent to your phone, after you enter your password. Here, the system gave out the secret keys needed to log in before it ever checked that second code. An attacker could skip the code entirely and still get in.

What is Account takeover?

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.

Similar reports

View all

Same bug class and techniques, clearest first.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.