Skip to content
Access control Write-up Intermediate

How I Exploited Amazon Cognito Misconfigurations to Access Confid

A leaked Cognito identity ID in local storage allowed an unauthenticated attacker to obtain temporary AWS credentials with excessive permissions, leading to full read access to S3 buckets containing confidential data.

1day Follow

Published on awstip.com

Hello friends, It’s me 1day, back with another interesting vulnerability I found in my Bug hunting journey. I’m a self taught cybersecurity enthusiast who loves to do bug hunting & programming.

1day, on awstip.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 Cognito Identity Pool was configured with an IAM role that granted excessive permissions, allowing unauthenticated users to obtain credentials with access to S3 buckets.

Impact

An attacker could read all contents of S3 buckets containing highly confidential data, including software design blueprints and SRS documents, potentially causing huge loss to the company.

What the attacker needed

Access to the web application; No authentication required

The fix

The Cognito Identity Pool's IAM roles should be configured with least privilege, granting only necessary permissions to authenticated users.

How it was found

  1. Find the Cognito identity ID in the browser's local storage.
  2. Use the AWS CLI to call get-credentials-for-identity with the identity ID.
  3. Configure a new AWS CLI profile with the temporary credentials and session token.
  4. Verify authentication by calling sts get-caller-identity.
  5. Enumerate accessible AWS services using a tool, discovering S3 bucket access.

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 website stored a user identifier in the browser's local storage. This identifier could be used to get temporary cloud credentials, which gave access to sensitive files stored in the cloud. The mistake was that the cloud permissions were too broad.

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.