Skip to content
Access control Write-up Intermediate

Chaining MFA-Enabled IAM Users with IAM Roles for Potential Privilege Escalation in AWS

AWS documentation and IAM Policy Simulator incorrectly indicated that sts:GetSessionToken could be denied by IAM policies, when in fact it cannot. This could lead organisations to misconfigure MFA protections and overlook privilege escalation paths where an MFA-enabled IAM user chains roles to gain higher privileges.

Jason Kao Follow

Published on praetorian.com

In AWS, sts:AssumeRole is an action within AWS’s Security Token Service that allows existing IAM principals to access AWS resources to which they may not already have access. For example, Role A can assume Role B and then use Role B’s privileges to access AWS resources.

Justin Copeland, on praetorian.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 root cause is that AWS's documentation and IAM Policy Simulator did not accurately reflect that sts:GetSessionToken cannot be denied by IAM policies, leading to misconfigurations.

Impact

An attacker with an MFA-enabled IAM user's long-term credentials could chain roles to escalate privileges, and organisations may overlook this path due to misleading documentation and tooling.

What the attacker needed

MFA-enabled IAM user credentials; MFA device and code; IAM role trust policies allowing assumption

The fix

AWS updated the sts:GetSessionToken documentation to clarify that it cannot be denied by IAM policies, and is planning to fix the IAM Policy Simulator.

How it was found

  1. Use the IAM user's access key and secret access key.
  2. Call sts:GetSessionToken with the MFA device and code to obtain temporary credentials.
  3. Use those temporary credentials to call sts:AssumeRole into Role B.
  4. Use the resulting credentials to call sts:AssumeRole into Role C.

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.

In AWS, an IAM user is a long-term identity with access keys. MFA (multi-factor authentication) adds a second step to log in. Some AWS actions, like getting temporary credentials, cannot be blocked by IAM policies even if you try. The report found that AWS's own documentation and a testing tool wrongly suggested you could block this action, which could cause people to leave a security gap open.

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.