Skip to content
Access control Write-up Intermediate

Two Auth Modes, One Bypass: Discovering a Hidden Attack Path in AWS AppSync

An AWS Amplify application used both Cognito User Pool and IAM authorization for its AppSync GraphQL API. A low-privilege self-registered user could exchange their Cognito JWT for temporary AWS credentials via the Identity Pool and then sign requests with SigV4 to bypass the Cognito group check and access admin-only endpoints.

splintercat Follow

Published on medium.com

During a recent AWS penetration test, I discovered an authorization bypass in an application built withAWS Amplify. The application used Amazon Cognito for authentication and AWS AppSync for its GraphQL API, with group-based access control restricting sensitive endpoints to admin users only.

Mark Roy, 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 AppSync schema allowed both Cognito User Pool group-based authorization and IAM authorization, and the Cognito Identity Pool issued the same authenticated IAM role with AppSync permissions to every authenticated user regardless of group membership.

Impact

A low-privilege authenticated user could access admin-restricted GraphQL queries and mutations, bypassing the intended Cognito group-based access control.

What the attacker needed

Self-registration enabled; victim has a valid account; attacker can intercept traffic

The fix

The report recommends removing IAM auth from sensitive queries, using Identity Pool role mapping based on Cognito groups, or adding resolver-level authorization checks.

How it was found

  1. Register an account and authenticate with Burp Suite proxying the traffic.
  2. Click the 'View Config' button to confirm access is denied via JWT.
  3. Extract the temporary AWS credentials captured in Burp and export them into an AWS CLI profile.
  4. Use awscurl to send a SigV4-signed request directly to the AppSync endpoint with the extracted credentials.

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 app had two ways to check who is allowed in: one using a login token (JWT) that includes group membership, and another using temporary cloud credentials (IAM). The second way did not check group membership, so any logged-in user could get those credentials and use them to reach admin-only data. This is like having a front door that checks your badge and a back door that only checks if you have any key at all.

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.

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.