Tag Your Way In - GCP Privilege Escalation Using Tags
A user with only viewer and tagUser roles could attach tags to resources, satisfying IAM conditions that grant higher privileges such as compute.admin. This allowed the user to perform privileged actions like removing a public IP from a VM without changing any IAM policy.
hackingthe.cloud
Published on hackingthe.cloud
GCP IAM Conditions allow fine-grained access control using context like time, resource type, and tags—but those same tags can enable unexpected privilege escalation. In this post, we show how a user with only viewer and tagUser roles can escalate to full admin access without changing any IAM policy.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely, the IAM condition trusted tags that could be modified by users with the tagUser role, creating a privilege escalation path.
Impact
An attacker could gain unauthorized access and full admin control over key services, and could maintain persistence by exploiting dynamic tag-based IAM conditions.
What the attacker needed
Viewer role; tagUser role; IAM policy with tag-based condition
How it was found
- Enumerate IAM policies to find tag-based conditions.
- List available tag keys and values.
- Bind a tag to the resource to satisfy the condition.
- Perform a privileged action that the condition now allows.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
In cloud systems, permissions are often granted based on labels (tags) attached to resources. If someone can change those labels, they might trick the system into giving them more access than intended. Here, a user with limited rights could add a tag that made the system think they should have admin rights.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.