Skip to content
Access control Write-up Intermediate

I Only Had Permission To Start A Build I Left As Gcp Project Owner

A low-privilege principal with only Cloud Build start permission and actAs on an over-privileged deploy service account could run a build as that account, which held projectIamAdmin, and thereby grant itself Owner. After a partial fix removed the Owner path, a leftover serviceAccountTokenCreator binding on an editor service account still allowed reading secrets.

nebty Follow

Published on systemweakness.com

On a recent authorized engagement (I will call the client Acme), a read-only review of a single GCP project turned into full project takeover, starting from an account that on paper could do almost nothing. Here is the exact chain, rebuilt as a lab you can run yourself.

Nebty, on systemweakness.com

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 deploy service account was granted the projectIamAdmin role, which includes the permission to rewrite the project's IAM policy, and a low-privilege principal could start builds as that account.

Impact

An attacker with only build-start permission could become project Owner, and even after a partial fix, a leftover impersonation grant still allowed reading secrets that the editor service account could access.

What the attacker needed

A GCP project; low-privilege account with builds.create; actAs on deploy service account; deploy SA has projectIamAdmin

The fix

The report recommends right-sizing the pipeline service account, removing unnecessary impersonation grants, restricting who can start builds, and enabling Data Access audit logs; the text describes a partial fix that closed the Owner path but left the data path open.

How it was found

  1. Impersonate the low-privilege builder service account.
  2. Attempt to grant Owner directly and observe permission denied.
  3. Submit a Cloud Build job configured to run as the deploy service account.
  4. The build runs as the deploy service account and grants Owner to the low-privilege principal.
  5. Verify the new Owner binding.
  6. After the partial fix, use the leftover tokenCreator permission to mint a token for the editor service account and read a secret.

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, a service account is a robot identity that programs use. This report shows that if you can make a build run as a powerful robot, you get all its powers, even if your own account looks weak. Later, a leftover permission to borrow another robot's identity still let the attacker read secrets after the obvious fix.

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.

More by nebty

View all

3 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

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.