IAM Privilege Escalation Paths
Description
Over‑permissive IAM policies enable users to escalate privileges in many ways: iam:PassRole to powerful roles and launch them on compute, sts:AssumeRole into admin roles, attaching AdministratorAccess to themselves, creating new policy versions with broader actions, updating a role’s trust policy to include self, or using CloudFormation/Glue/CodeBuild/SSM to pivot into higher privilege.
Examples
Identify Risky Permissions
aws iam list-attached-user-policies --user-name <user>
aws iam list-user-policies --user-name <user>
aws iam simulate-principal-policy --policy-source-arn arn:aws:iam::<acct>:user/<user> \
--action-names iam:PassRole iam:AttachUserPolicy iam:CreateAccessKey sts:AssumeRole
aws accessanalyzer validate-policy --policy-document file://policy.json
Attempt Role Assumption / PassRole
aws sts assume-role --role-arn arn:aws:iam::<acct>:role/<role> --role-session-name test
If allowed, the principal can laterally escalate privileges.
Detect self‑management and policy version traps
aws iam list-policies --only-attached --query "Policies[?PolicyName=='AdministratorAccess']"
aws iam list-policy-versions --policy-arn <policy-arn>
aws iam get-role --role-name <role> --query 'Role.AssumeRolePolicyDocument'
Remediation
- Apply least privilege; avoid wildcards on
Action/Resource. - Restrict
iam:PassRoleto specific roles with conditions (e.g.,iam:PassedToService). - Disallow self‑management of policies; enforce approvals and SCP guardrails.
- Use permission boundaries and session controls
- Apply permission boundaries to identities that create/modify roles; require MFA (
aws:MultiFactorAuthPresent) and limit session duration/conditions in trust policies.
- Apply permission boundaries to identities that create/modify roles; require MFA (
- Detect and prevent
- Enable AWS IAM Access Analyzer for external access findings; alert on
CreatePolicyVersion,AttachUserPolicy,PassRole, and trust policy updates in CloudTrail.
- Enable AWS IAM Access Analyzer for external access findings; alert on
- Use Access Analyzer to detect external access and high‑risk permission paths.