The green node is a serverless function with an unsanitized-input code-injection bug. Every function is deployed with an IAM role — a policy describing exactly which cloud resources it may touch. When an attacker exploits the bug, they don't get their own narrow set of permissions: they inherit and can freely exercise the function's entire granted role.
attacker_reach = granted_resources(function.iam_role)
NOT attacker_reach = function.intended_purpose
- Over-privileged — the role was granted broad account access "for convenience". One exploited function now reaches every database, bucket, queue and secret in the account.
- Least-privilege — the role is scoped to only the single table the function's code actually reads or writes. The identical exploit is contained to that one resource.
- Toggle the scope, inject the same exploit again, and compare the two run counters — the vulnerability never changes; only the blast radius does.
Real-world relevance: this is why cloud security teams treat IAM policy review as a first-class defense — the code-injection bug may be unavoidable in the short term, but a tightly scoped role turns a full account compromise into a single-table incident.