Skip to content
Access control Write-up Intermediate

How I Discovered a Cognito Misconfiguration That Bypassed Corporate SSO and Exposed a Production Deployment Manager

Self-service signup was enabled on a Cognito user pool that was meant to be accessed only through corporate SSO. An attacker could register an account, authenticate via SRP, obtain AWS credentials from the identity pool, and access a production deployment dashboard with the ability to trigger deployments and change target accounts.

1day Follow

Published on 1-day.medium.com

Hey all, I’m back with another article on an issue I discovered recently. If you’ve read my earlier post on AWS Cognito and S3, you already know that I find this service interesting.

1day, on 1-day.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

Any authenticated Cognito user could trigger real deployments, change target AWS accounts to exfiltrate build artifacts and secrets, and read the full SSM dependency graph.

What the attacker needed

No corporate account needed; Self-service signup enabled; Access to the target web app

How it was found

  1. Open the target site and inspect the JavaScript bundle to find the Cognito UserPoolId, AppClientID, IdentityPoolID, region, OAuth domain, and API Gateway endpoint.
  2. Use the AWS CLI to call the Cognito SignUp action with the client ID and a test email address.
  3. Confirm the new account by calling ConfirmSignUp with the OTP received by email.
  4. Use a Python script with the pycognito library to perform the USER_SRP_AUTH flow and obtain IdToken, AccessToken, and RefreshToken.
  5. Inject the tokens into the application's localStorage under the Amplify keys and reload the page.
  6. The dashboard loads with full access, including the ability to trigger deployments and edit target accounts.

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.

The login page only offered a corporate single sign-on button, which normally means outsiders cannot get in. However, the underlying user directory (AWS Cognito) still allowed anyone to create a new account directly. Once the attacker had an account, the application gave them temporary cloud credentials that let them use the internal deployment tool.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by 1day

View all

3 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.