Skip to content
Account takeover Write-up Intermediate

How I was able to takeover any account (Zero-click ATO)

A misconfiguration in Amazon Cognito allowed an attacker to register a new account using an existing victim's email address with different letter casing, because Cognito treated the email as case-sensitive while the application did not. The attacker could then obtain an access token for the victim's account and log in even after the victim changed their password.

Mohammed Al-Barbari Follow

Published on m4dm0e.github.io

I am Mohammed Fadhl Al-Barbari, a cybersecurity researcher, tools builder, and bug hunter from Yemen, active on platforms such as HackerOne (H1), BugCrowd, and SRT.

Mohammed Al-Barbari (@m4dm0e), on m4dm0e.github.io

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 and Amazon Cognito handled email case sensitivity inconsistently, allowing duplicate accounts with the same email but different casing, and Cognito issued access tokens that were valid for the original account.

Impact

An attacker could take over any account and maintain access even after the victim changes their password, as the attacker's case-variant account remains valid.

What the attacker needed

Knowledge of victim's email; ability to send requests to Cognito endpoint; no user interaction required

How it was found

  1. Create a test account with a normal email address.
  2. Intercept the sign-up request and note the Cognito endpoint and client ID.
  3. Send a new sign-up request directly to the Cognito endpoint using the victim's email with different capitalisation.
  4. Log in via AWS CLI using the new email and password to obtain an access token.
  5. Use the access token to log into the application as the victim.

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 sign up, the system usually checks if your email is already used. Here, the system treated '[redacted]' and '[redacted]' as different emails, so an attacker could create a new account with the victim's email but different capitalisation. The attacker then got a login token that worked for the victim's real account, letting them access it even after the victim changed their password.

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.