Skip to content
Access control Write-up Advanced

Auth bypass: Leaking Google Cloud service accounts and projects

The IAM API's pageToken for listing service accounts was a forgeable protobuf that included the project number, allowing an attacker to list service accounts of any project without permission. This could leak project numbers and potentially project IDs, enabling further scanning for unsecured resources.

Ezequiel Pereira Follow

Published on ezequiel.tech

on August 26, 2020

Ezequiel Pereira, on ezequiel.tech

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 pageToken was a client-side protobuf that included the project number and was not integrity-protected, so the server trusted it without verifying authorization for the specified project.

What the attacker needed

Knowledge of victim project number; no permissions on victim project

The fix

The issue was fixed by Google, likely by making the pageToken opaque or verifying authorization for the project number in the token.

How it was found

  1. Send a request to list service accounts with a small page size to obtain a pageToken.
  2. Decode the pageToken from base64 and inspect the protobuf structure.
  3. Identify the field containing the project number and modify it to a victim's project number.
  4. Re-encode the modified protobuf as base64 and use it as the pageToken in a new request.
  5. Observe that the response contains service accounts from the victim project.

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.

The service that lists service accounts in Google Cloud used a page token to fetch the next page. That token was not random but encoded data that included the project number. By changing the project number inside the token, an attacker could see service accounts of other projects without permission.

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 Ezequiel Pereira

View all

7 more disclosed reports, best first.

More from Google

View all

The newest disclosed reports for this program.

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.