AWS IAM privilege escalation happens when a low-privilege identity abuses IAM permissions to gain higher privileges, usually by attaching an admin policy to itself, creating a new policy version, making access keys for another user, or passing a powerful role to a compute service. It is mapped to MITRE ATT&CK T1098 and T1548, and it is prevented with least privilege, permission boundaries and continuous monitoring.
Key takeaways
- Privilege escalation turns a minor compromise into a full account takeover — the attacker starts with little and ends with admin.
- Seven paths cause most incidents: policy edits, role attachment, access-key creation, PassRole abuse, Lambda code changes, trust-policy edits and secrets theft.
- Least privilege, permission boundaries, service control policies and CloudTrail monitoring close these paths before they are used.
Most AWS breaches do not start with an administrator account. They start with a developer key, a compromised application role or a forgotten test user — and then the attacker finds a path to admin that nobody mapped. IAM privilege escalation is that path, and it is one of the most common findings in cloud security assessments.
What is AWS IAM privilege escalation?
AWS IAM privilege escalation is the act of turning a limited AWS identity — an IAM user, an assumed role, or a set of leaked long-term keys — into one with substantially more power, often full administrator access. The attacker does not exploit a software bug; they abuse IAM permissions the identity already has.
MITRE ATT&CK lists this behavior under T1098: Account Manipulation, which covers both the persistence and privilege escalation tactics, and under T1548: Abuse Elevation Control Mechanism. The key insight from MITRE is that the attacker must already have some permissions to change accounts — but those changes can then grant access to additional roles and higher-privileged accounts.
Think of IAM as a directed graph. Every principal — user, role, service or federated identity — is a node, and every permission that grants power over another principal is an edge. If you can describe an attack path in one sentence, such as "the web app role can assume the deploy role, which can pass the admin role to Lambda," you have a finding.
How does IAM privilege escalation work?
Almost every IAM privilege escalation follows the same four steps: land with a limited identity, enumerate what it can do, find a path to more power, and then use that power to persist. Knowing the chain helps you see where to break it.
Land. The attacker starts with any foothold: a leaked access key in a public repository, a phished developer, an SSRF flaw that reaches the EC2 instance metadata service, or a compromised application role.
Enumerate. The attacker maps what the identity can do: which policies are attached, which roles can be assumed, which groups it belongs to, and what the trust policies allow. Tools such as Pacu automate this — its iam__privesc_scan module checks for known escalation paths — but the AWS CLI calls are simple: list the attached and inline policies, then read them.
Escalate. The attacker uses one of the paths below to gain more power — usually in a single API call.
Persist. Once admin, the attacker creates a backdoor: a new access key, a new user, or a loosened trust policy, so losing the original foothold does not matter.
What are the most common IAM privilege escalation techniques?
Rhino Security Labs catalogued 21 distinct IAM privilege-escalation methods in 2018, and most of them still work in 2026 in environments where IAM grew without review. In practice, seven paths cause the majority of real incidents. The table below summarizes them; the sections after it explain each one.
| Path | Abused IAM actions | MITRE ATT&CK | Result |
|---|---|---|---|
| Policy version abuse | iam:CreatePolicyVersion, iam:SetDefaultPolicyVersion | T1548 | Admin policy switched on |
| Policy attachment | iam:AttachUserPolicy, iam:AttachRolePolicy, iam:PutUserPolicy | T1098.003 | Admin policy attached to self |
| Access key creation | iam:CreateAccessKey, iam:CreateLoginProfile | T1098.001 | Keys for a more powerful user |
| PassRole to compute | iam:PassRole with ec2:RunInstances or lambda:CreateFunction | T1548 | Code runs as a powerful role |
| Lambda code change | lambda:UpdateFunctionCode on a privileged function | T1059.009 | Code runs as the function role |
| Trust policy rewrite | iam:UpdateAssumeRolePolicy, sts:AssumeRole | T1078.004 | Attacker can assume an admin role |
| Secrets theft | secretsmanager:GetSecretValue, ssm:GetParameter | T1552.001 | High-trust credentials stolen |
1. Policy version abuse: CreatePolicyVersion
If an identity can create a new version of an existing managed policy and set it as the default, it can rewrite that policy to allow everything, then use the policy's existing attachments. The classic target is a policy already attached to a powerful role: the attacker edits the policy, and the role silently gains admin rights.
The fix is to never grant iam:CreatePolicyVersion or iam:SetDefaultPolicyVersion to non-admin identities, and to alert on every CreatePolicyVersion event in CloudTrail.
2. Policy attachment: AttachUserPolicy and PutUserPolicy
These are the most direct paths. iam:AttachUserPolicy lets an identity attach any managed policy — including AdministratorAccess — to itself. iam:PutUserPolicy does the same with an inline policy. iam:AttachRolePolicy does it sideways, attaching a powerful policy to a role the attacker can then assume.
Any of these permissions on a resource of star is a critical finding. They should exist only on identities that are meant to administer IAM, and those identities should require MFA and be few in number.
3. Access key creation for another user
iam:CreateAccessKey lets an identity create a new access key pair for another IAM user — including an administrator. The attacker creates the key, uses it to act as the admin, and the victim never notices because their own key still works. iam:CreateLoginProfile and iam:UpdateLoginProfile do the same for console passwords.
MITRE maps this to T1098.001, Additional Cloud Credentials, and notes that it serves both privilege escalation and persistence: the new key is a lasting way back in.
4. PassRole to a compute service
iam:PassRole lets an identity attach a role to an AWS service. If a principal can call lambda:CreateFunction or ec2:RunInstances and pass an arbitrary role to it, they can execute code as that role. A developer who can create a Lambda function and pass the admin role to it is effectively an admin.
The fix is to constrain iam:PassRole by exact role ARN, never by star, and to require that the role being passed is no more powerful than the identity passing it. AWS's Security Blog on PassRole warns that a wildcard resource lets a principal pass any role in the account, opening the possibility of unintended privilege escalation.
5. Lambda code change on a privileged function
If an identity can call lambda:UpdateFunctionCode on a function that runs with a powerful role, it can replace the function's code with its own and wait for the function to run. The attacker's code then executes with the function's permissions — which may include access to databases, secrets and other services.
This path is easy to miss because the permission looks harmless: updating code is a developer task. The risk is the role the function runs as, not the code itself. Review the roles attached to every Lambda function, not just who can edit the code.
6. Trust policy rewrite and role assumption
A role's trust policy decides who can assume it. iam:UpdateAssumeRolePolicy lets an identity rewrite that policy — for example, to allow its own account or an external account to assume an admin role. Federation makes this worse: a GitHub Actions OIDC integration with a wildcard subject condition can let any repository in an organization assume a deployment role.
Review trust policies as carefully as permission policies. Any trust policy that allows star, an account root, or a wildcard OIDC subject is a finding worth fixing immediately.
7. Secrets theft: Secrets Manager and Parameter Store
Some identities do not need to escalate through IAM at all: they can read the credentials directly. secretsmanager:GetSecretValue or ssm:GetParameter on high-trust secrets — database passwords, API keys, admin credentials — hands the attacker the keys to a more powerful identity.
Scope secrets access as tightly as IAM permissions, and prefer secrets that are scoped to a single application. A secret readable by every developer is a secret shared with every attacker who compromises a developer.
What is the difference between privilege escalation and persistence?
Privilege escalation gains more power; persistence keeps access. The two overlap constantly in AWS, which is why MITRE lists account manipulation under both tactics. Creating an access key for an admin user escalates your privileges, and the new key also gives you a lasting way back in if the original foothold is closed.
The practical consequence is that incident response must look for both. Removing the attacker's initial access is not enough if they created a new user, a new key or a backdoored trust policy while they were admin. After any suspected escalation, audit all IAM changes in the window: new users, new keys, new policy versions and trust policy edits.
How do you detect IAM privilege escalation?
Every path above leaves CloudTrail events, which is good news: IAM privilege escalation is one of the most detectable cloud attacks, if anyone is watching. The events to alert on are the IAM write calls themselves, especially when they come from an unusual identity, IP address or time of day.
Three layers of detection work best together. CloudTrail with alerts on IAM write events catches the act itself. GuardDuty flags suspicious IAM behavior, such as unusual API calls and credential use from new locations. IAM Access Analyzer flags the conditions that make escalation possible, such as policies that grant external or overly broad access, before they are used.
Also watch for enumeration. An attacker usually lists policies, roles and users before escalating, so a burst of iam:List and iam:Get calls from an identity that never made them before is an early warning. Correlate it with the source IP: enumeration from a new address is far more suspicious than the same calls from your office network.
How do you prevent IAM privilege escalation?
Prevention is least privilege, enforced in depth. The AWS Well-Architected Framework's security pillar states the rule plainly: grant only the access that users require to perform specific actions on specific resources under specific conditions. The implementation is a set of controls that reinforce each other.
- Grant least privilege: give each identity only the permissions its job needs, on the specific resources it needs, and review them regularly. AWS notes that IAM users and roles have no permissions by default — every permission is a choice you made.
- Ban wildcards on identity actions: never grant iam:AttachUserPolicy, iam:PutUserPolicy, iam:CreatePolicyVersion, iam:CreateAccessKey or iam:PassRole on a resource of star. Treat any of these on star as a critical finding.
- Constrain PassRole: allow passing only specific role ARNs, and only to the services that need them.
- Use permission boundaries: set a maximum permissions boundary on roles that developers can create, so even a misconfigured policy cannot exceed it.
- Use service control policies: at the organization level, SCPs can block the most dangerous actions across member accounts, even for admins.
- Prefer roles and federation: replace long-lived access keys with IAM roles and temporary credentials from STS, and federate workforce access through IAM Identity Center.
- Use IAM Access Analyzer: generate policies from up to 90 days of CloudTrail activity, validate policies before deployment, and review unused access findings monthly.
- Protect the root user: lock it with MFA, delete its access keys, and never use it for daily work.
AWS's own least-privilege guidance recommends the same workflow: build policies from observed activity with Access Analyzer, test them before deployment, and remove permissions that are never used. Our small business cybersecurity checklist covers the same discipline — least privilege, MFA and regular review — for teams without a dedicated cloud security role.
For the identity side of a wider program, our best Microsoft 365 backup guide covers what happens when an over-permissioned account is used to destroy data.
Our top cybersecurity companies in Brazil guide lists firms that run cloud security assessments if you want an outside review.
What should you do if you find a privilege escalation path?
Finding a path is a gift: it means you can close it before an attacker uses it. Treat it as a critical finding, fix it in order of exploitability, and then check whether it was already used.
- Score it: rank paths by how easily they can be reached — an internet-facing application role with PassRole to Lambda is more urgent than a path needing an admin's key.
- Remove the permission: take away the dangerous action, scope it to a specific resource, or add a condition that limits where and when it works.
- Add a boundary: apply a permissions boundary or SCP so the same mistake cannot be repeated by another policy.
- Check CloudTrail history: search the last 90 days for the same calls. If the path was used, assume persistence was established and audit all IAM changes in that window.
- Rotate credentials: if any key or secret may have been exposed, rotate it and review the sessions it was used in.
- Re-test: run the same enumeration again after the fix to confirm the path is closed, and add the check to your regular review.
Phishing is still the most common way attackers get the first foothold. Our spear phishing guide explains how targeted attacks steal the credentials that start this chain, and why phishing-resistant MFA matters for every identity that can touch IAM.
The bottom line
IAM privilege escalation is not an exotic attack. It is a small set of well-known paths — policy edits, role attachment, access-key creation, PassRole abuse, Lambda code changes, trust-policy rewrites and secrets theft — used against IAM that grew without review. Rhino Security Labs counted 21 methods years ago, and most still work today.
Close them with least privilege, permission boundaries and service control policies, and watch CloudTrail for the six events in this article. The identity that looks unimportant today is the admin account of tomorrow if its permissions are never reviewed.
Frequently asked questions
What is AWS IAM privilege escalation?
It is the act of turning a limited AWS identity, such as an IAM user, an assumed role or a set of leaked long-term keys, into one with substantially more power, often full administrator access. The attacker abuses IAM permissions the identity already has, such as attaching policies or creating access keys, rather than exploiting a software bug.
What is the most common IAM privilege escalation technique?
Policy manipulation is the most common family: iam:CreatePolicyVersion, iam:AttachUserPolicy and iam:PutUserPolicy let an identity grant itself or another identity more permissions. PassRole abuse is close behind, where an identity passes a powerful role to a Lambda function or EC2 instance it controls and then runs code as that role.
How many IAM privilege escalation methods exist?
Rhino Security Labs catalogued 21 distinct IAM privilege-escalation methods in 2018, and most of them are still exploitable in 2026 in environments where IAM grew without review. In practice, a handful of paths show up over and over in real assessments: policy edits, role attachment, access-key creation and PassRole abuse.
How do you detect IAM privilege escalation?
Monitor CloudTrail for IAM change events such as CreatePolicyVersion, AttachUserPolicy, PutUserPolicy, CreateAccessKey, UpdateAssumeRolePolicy and unusual AssumeRole calls, especially from new IP addresses or outside business hours. GuardDuty and IAM Access Analyzer can flag many of these events automatically.
What is the difference between privilege escalation and persistence in AWS?
Privilege escalation gains more power, while persistence keeps access. The same action can do both: creating an access key for another user escalates privileges and also gives the attacker a lasting way back in. MITRE ATT&CK lists account manipulation under both tactics for this reason.
Can IAM privilege escalation happen without an admin account?
Yes, and that is the point. The attacker starts with a low-privilege identity — a developer role, a leaked key, a compromised application role — and uses the permissions that identity already has to reach admin. No admin credentials are needed at the start, which is why the initial compromise often looks unimportant.
What is PassRole and why is it dangerous?
PassRole is the permission to attach an IAM role to an AWS service, such as a Lambda function or an EC2 instance. If a principal can pass an arbitrary role to a service it can control, it can run code as that role. PassRole with a resource of star is effectively admin access, and it should always be constrained to specific role ARNs.
Sources
- MITRE ATT&CK — Technique T1098: Account Manipulation
- AWS Well-Architected Framework — SEC03-BP02 Grant least privilege access
- AWS Builder Center — Beyond Passwords: Applying Least-Privilege Access in AWS IAM
- MITRE ATT&CK — Technique T1548: Abuse Elevation Control Mechanism
- AWS Security Blog — How to use the PassRole permission with IAM roles
- Rhino Security Labs — AWS IAM Privilege Escalation: Methods and Mitigation
- Pacu — The AWS exploitation framework (GitHub)
The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.
Checked against MITRE ATT&CK T1098 and T1548, the AWS Well-Architected Security Pillar, AWS least-privilege guidance, the AWS Security Blog on PassRole, and Rhino Security Labs' 2018 privilege-escalation research and the Pacu framework.
How we write and fact-check →