Lion Cipher Lab

Exploit the AWS cross-account confused deputy — then close it with an ExternalId

Why it matters

Nearly every SaaS security or cloud-cost vendor you integrate ('give us a cross-account role and we'll scan your account') relies on cross-account AssumeRole. Get the trust policy wrong — omit the ExternalId — and you have handed a capability to a shared 'deputy' that any of the vendor's other tenants, or anyone who learns your role ARN and the vendor's account id, can aim at your account. It is one of the oldest and most repeated cloud misconfigurations, AWS built an entire condition key specifically to prevent it, and reviewers still miss it. Doing the attack once makes the fix…

What you'll learn

Steps in this lab

  1. The confused deputy in one picture
  2. Start a local multi-account AWS with LocalStack
  3. Create the victim role with the VULNERABLE trust policy
  4. Exploit: the deputy assumes the victim role for the attacker
  5. Fix: require an ExternalId in the trust policy
  6. Re-prove: wrong / missing ExternalId is denied, correct one works
  7. What to remember — and the named failure modes
  8. Tear down

Open the full interactive lab →