Skip to content
Access control Write-up Intermediate

Sometimes What Sounds Benign Can Bite You: An Unexpected Implication of Lambda Privileges

A user holding the AWS permission to update Lambda function code could rewrite the Lambda that governs Amplify Studio's Cognito custom authentication, disabling the one-time code challenge. This could let that user gain unauthorised access to the Amplify Studio environment, which carries administrator-equivalent privileges.

Ermetic Team Follow

Published on ermetic.com

Subscribe

Ermetic Team, on ermetic.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 permission to update Lambda function code was granted broadly (resource: *) in an account where Amplify's authentication Lambda lived, so a developer could rewrite security-critical logic.

Impact

A user with that permission could gain unauthorised access to Amplify Studio, which the text says operates with administrator-equivalent privileges; the text notes the setup requires relatively high privileges, no account segregation and a deployed Amplify service.

What the attacker needed

An AWS account with Amplify deployed; lambda:UpdateFunctionCode permission; no account segregation between workloads

The fix

Restrict lambda:UpdateFunctionCode to specific function resources rather than a wildcard, and isolate Amplify workloads in their own AWS account.

How it was found

  1. Open Amplify Studio and inspect its access control settings and the requests it sends.
  2. Trace the authentication setup to the Cognito user pool, its Full Access group and the attached IAM role.
  3. Follow the custom authentication flow to the Lambda functions that implement it.
  4. Inspect the login-define-auth Lambda and note the boolean that decides whether tokens are issued.
  5. Change that boolean so the one-time code challenge is skipped.
  6. Log in again and observe that the new code runs, granting access without the challenge.

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 Lambda lets you run small pieces of code in the cloud without managing servers. Here, a login check for a web tool was itself a Lambda function, so anyone allowed to edit that function's code could change the check to always say yes. The lesson is that a permission that sounds narrow, like editing code, can quietly amount to full control.

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 from AWS

View all

The newest disclosed reports for this program.

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.