Ask a team to describe their AWS security and you usually hear about the edge: security groups, the WAF, which ports are open. That edge matters. But in a cloud account, the thing that decides how bad a bad day gets is something else entirely: which identities can act as which other identities.
An attacker who lands on one EC2 instance, one Lambda function or one CI runner holds that thing's permissions. The question that matters next isn't "what can this role do?" It's "what can this role become?"
The permission that hands over another permission
AWS has a permission that shows the problem well: iam:PassRole.
PassRole lets an identity hand a role to an AWS service. You need it to launch an EC2 instance with an instance profile, or to create a Lambda function that runs as a role. It's ordinary, and it's everywhere.
AWS's own documentation spells out the risk with a simple example. A user who can't touch S3 at all can still pass an S3-capable role to a service, and that service then does the S3 work for them. AWS warns you to make sure a user "doesn't pass a role where the role has more permissions than you want the user to have".
In other words, the effective permissions of an identity are not what's written in its policy. They're what's written in its policy plus everything in every role it can pass, assume or create.
The part that doesn't show up in your logs
There's a second detail on the same AWS page that most teams don't know: PassRole is not an API call. CloudTrail doesn't log a PassRole event. You only see it indirectly, inside the log entry of whatever call created or changed the resource that received the role.
So if you're hunting for privilege escalation by searching logs for "PassRole", you'll find nothing. It's not because nothing happened. It's because that's not where the evidence lives.
AWS also says not to rely on resource tags to control who can pass a role, because that approach "does not have reliable results". Scope it by the role's ARN and by the service it's passed to instead.
Why "no admin policy attached" isn't comforting
A typical review looks at each role and asks whether it's an admin. Most roles aren't, so the review passes.
Here's what that review misses. Picture three roles, none of them flagged:
- A build role used by CI. It can create Lambda functions and pass one specific role. Reasonable.
- A deploy role that functions run as. It can assume a role in the data account to run migrations. Reasonable.
- A data role with broad read access to customer tables. Reasonable for what it does.
Each policy is defensible on its own. Together they form a straight line from "whoever controls the CI pipeline" to "customer data". That line exists in no single policy document. It exists only in the graph.
One over-scoped token is enough
This isn't theoretical. In July 2025, AWS published a security bulletin about the Amazon Q Developer extension for VS Code. An "inappropriately scoped GitHub token" in a CodeBuild configuration let someone commit malicious code that shipped automatically in a release. The code didn't work only because of a syntax error. AWS revoked the credentials and shipped a clean version.
The lesson isn't about one vendor. It's that a token sitting in a build system often has more reach than anyone remembers granting it, and the build system is exactly where attackers like to start.
What least privilege actually asks of you
AWS's IAM best practices say to grant only the permissions a task needs. They also admit the reality: teams start broad and narrow over time. AWS even warns that its own managed policies "might not grant least-privilege permissions" for your use case.
That's the honest picture. Least privilege isn't a setting. It's a direction you keep moving in. A few things help:
- Use the access data AWS already has. IAM Access Analyzer can generate policies from real CloudTrail activity, run policy checks, and flag unused roles, unused access keys and unused permissions. Unused access is free to remove and pure upside for an attacker.
- Scope PassRole tightly. Name the exact role ARNs and use the
iam:PassedToServicecondition. A wildcard on PassRole is a wildcard on every role in the account. - Set guardrails above the account. Service control policies, resource control policies and permissions boundaries put a ceiling on what any role can do, even if someone writes a careless policy later.
- Review paths, not just policies. For every identity an outsider could plausibly control (CI runners, public-facing compute, third-party integrations), ask what it can pass, assume or create, and follow the chain to the end.
Why this needs an attacker's eyes
The last point is the hard one. Humans review policies one at a time because that's how the console shows them. Attackers don't. They start from wherever they landed and ask "what next?" over and over, which is exactly the search a reviewer skips.
That's the work an AI red team is suited to: walking the identity graph of your own account, only with your permission, and showing the full path from a foothold to something that matters, with proof. At Antivenom, every path like that goes to the AI blue team, which tightens the weakest link and has the red team walk the path again to confirm it's closed.
If you want the bigger picture of why one quiet setting is enough now, read why static security rules can't stop AI attackers.