Policy Attachment and Modification Escalation
What you'll learn: How attackers with limited IAM permissions can escalate privileges by attaching or modifying policies on identities they control.
The Core Vulnerability
Imagine you're a building manager who can't enter the vault, but you can change which keys unlock it. That's policy attachment escalation in a nutshell. An attacker with permissions like iam:AttachUserPolicy, iam:PutUserPolicy, or iam:UpdateAssumeRolePolicy can grant themselves or controlled identities administrative access—even if they started with minimal privileges.
How It Works
There are several attack vectors:
Managed Policy Attachment: If you have iam:AttachUserPolicy, you can attach the AdministratorAccess managed policy to your own user account, instantly gaining full control.
Inline Policy Creation: With iam:PutUserPolicy or iam:PutRolePolicy, you can create a new inline policy granting broad permissions directly on an identity you control.
Trust Policy Manipulation: The iam:UpdateAssumeRolePolicy permission lets you modify a role's trust policy to allow your identity to assume a privileged role, effectively borrowing its permissions.
Policy Version Manipulation: Using iam:CreatePolicyVersion on a managed policy can inject malicious permissions if you can set it as the default version.
Why It's Dangerous
These permissions seem administrative but not directly powerful—yet they control who gets power. Defenders often overlook them during access reviews because they don't appear as "data access" permissions. Permission boundaries should prevent this, but misconfigurations are common.
Key Takeaway: Permissions to attach or modify IAM policies are indirect administrator privileges—treat them as critically as direct admin access, and always protect them with permission boundaries and strict controls.