Skip to content
Account takeover Write-up Intermediate

Account Take Over Due to AWS Cognito Misconfiguration | by Deshine

The AWS Cognito user registration flow allowed a new user to supply an existing custom:userId and set ForceAliasCreation to true, which replaced the previous user's custom:userId with the new one. This let the new user take over the owner account, though the UUID format of custom:userId reduced the severity to high.

Deshine Follow

Published on medium.com

In this post, I will share how I check the misconfiguration in AWS Cognito leads to Account Takeover.

Deshine, 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 did not verify that the custom:userId value was unique and not already assigned to another user before allowing registration with ForceAliasCreation set to true.

Impact

A new user could take over the owner account, but the UUID format of custom:userId reduced the severity to high.

What the attacker needed

Ability to register a new account; knowledge of a victim's custom:userId

How it was found

  1. Register a new user with a chosen username, password, email, and a custom:userId value.
  2. Confirm the OTP to complete registration.
  3. Register another new user using the same custom:userId and set ForceAliasCreation to true.
  4. Confirm the OTP for the second registration, which replaces the previous user's custom:userId.

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.

AWS Cognito is a service that handles user sign-up and login. The app stored a unique user ID in a custom field, and the sign-up process did not check if that ID already belonged to someone else. By reusing an existing ID during registration, a new user could take over the original account.

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.

More by Deshine

View all

1 more disclosed report, best first.

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.