# 1-click Oauth client takeover through henhouse UI

Protobuf `pb` param in Google Cloud henhouse UI was fully attacker-controllable, letting a crafted link auto-fill and auto-submit OAuth client config changes and create Owner service accounts in one click.

- Payout: $10,203
- Severity: high
- Program: Google
- Found by: rand0m_unk0wn
- Disclosed: 2025-06-27
- Write-up quality: 7/10
- Original: https://web.archive.org/web/20260527192347/https://random-unknown-username.github.io/random-unknown-username/ (archived copy; the original page https://random-unknown-username.github.io/random-unknown-username/ is gone)
- Library page: https://bugbountylibrary.com/r/blog%3Arandom-unknown-username-github-io-random-unknown-username
- Tags: area:web domain:web impact:integrity impact:privesc kind:bounty platform:blog sev:high technique:chained technique:fuzzing vuln:access-control vuln:business-logic vuln:privilege-escalation

**Target:** Google Cloud Console henhouse OAuth client creation flow (pb protobuf parameter)
**Root cause:** The `pb` URL parameter is a serialized protobuf that drives the entire henhouse UI flow, and its fields (titles, origins, flow selector, auto-submit booleans, owner account) were trusted and rendered/executed without server-side validation or integrity protection.
**Steps:**
1. Open `https://console.developers.google.com/henhouse/?pb=[...]` with the long protobuf array from the prior xdavidhu report.
2. Mutate the title string field (e.g. `"Create API key"` -> arbitrary text) and observe it rendered in the UI.
3. Change the flow selector field `0` to `1`/`2`/`3` to switch to different UI flows (e.g. service account creation).
4. Fuzz remaining fields with a Python script; set origin/redirect fields to attacker values like `"WEB_BROWSER","WEB_BROWSER","https:%2F%2Fs70pb9ag.ssrf.cvssadvisor.com"`.
5. Toggle the boolean fields near the end of the array to make the form auto-fill and the `Next` button auto-click.
6. Set the owner field to `["owner"]` to force creation of an Owner-level service account.
7. Deliver the single link to a victim; on click, OAuth client origins are overwritten/created or an Owner service account is generated, then social-engineer drag-and-drop of credentials.
**How found:** Read xdavidhu's 2020 domain-check bypass report and habitually tried to reproduce/bypass it. Noticed the long `pb` parameter controlled the whole page flow, randomly mutated the title string, saw it reflected, then changed the lone `0` flow selector to `1` and got a different UI. Wrote a Python fuzzer over all fields, found nearly all controllable, then toggled booleans to auto-submit and set owner field for privilege escalation.
**Exploitation:** Attacker crafts a henhouse URL with a malicious `pb` protobuf that pre-fills all fields and auto-submits. Victim clicks once; the flow overwrites authorized JavaScript origins on all victim OAuth client IDs, creates new client IDs with attacker redirect URIs, or creates an Owner-level service account. Second variant adds a drag-and-drop step to exfiltrate the generated credentials into the attacker's account.
**Escalation:** Chained UI spoofing -> arbitrary protobuf field control -> auto-submit -> OAuth client takeover -> Owner service account creation -> credential exfiltration, raising a low-severity spoof into full project takeover.
**Insight:** When a URL parameter is a serialized protobuf/struct driving a multi-step wizard, enumerate every field including booleans and enum selectors — auto-submit flags and role/owner fields turn a reflected-string spoof into a 1-click state-changing action.

## Proof of concept (copied exactly from the original report)

**henhouse pb parameter with flow selector 0**

```
https://console.developers.google.com/henhouse/?pb=["hh-0","gmail",null,[],"https://developers.google.com",null,[],null,"Create API key",0,null,[],false,false,null,null,null,null,false,null,false,false,null,null,null,null,null,"Quickstart",true,"Quickstart",null,null,false]
```

**Protobuf array with magic flow selector field**

```
[
 "hh-0", // UI flow selector
 "gmail", // API to enable
 null,
 [], // random junk
 "https://developers.google.com", // allowed origin
 null,
 [],
 null,
 "Create API key", // title text
 0, // ← THE MAGIC FLOW SELECTOR
 null,
 [], // owner account stuff
 false,
 false,
 // ... 20 more fields ...
 "Quickstart", true, "Quickstart", null, null, false
]
```

**Auto-fill payload for OAuth origin overwrite**

```
"WEB_BROWSER","WEB_BROWSER","https:%2F%2Fs70pb9ag.ssrf.cvssadvisor.com",...
```

