# Leaked Google OAuth Token? Revoke App Access

> Google OAuth token exposed on GitHub? Remove the app's access in your Google Account, rotate its client secret and review the grant. Step-by-step guide.

Source: https://leakwatch.net/secrets/google-oauth-token

---

[LeakWatch](/)

[Product](/product)[Live feed](/leaks)[Guides](/secrets)[Blog](/blog)[Free scan](/)

1.  [Home](/)
2.  [Secrets](/secrets)
3.  Google OAuth Token

Cloud · Secret guide

# Leaked Google OAuth Token: what to do in the first hour

High severityChecked liveLast verified October 23, 2026 · 5 min read

A Google OAuth access token lets an application act on behalf of a Google user, within the scopes that user approved. Depending on those scopes, the holder can read and send mail, open files in Drive, view calendars or reach other Google services that the user connected. The token is short-lived, but that does not make it safe: a leaked token is often pasted next to a longer-lived refresh token or the app’s client secret, and those keep the access alive. Remove the app’s access first, then check what it did.

[Check your GitHub account for leaked secrets — free](/)

Provider

Google

Severity

High

Impact

Source code and build access

Checked live by LeakWatch

Yes

Revoke at

[Google](https://myaccount.google.com/permissions)

## What a Google OAuth Token looks like

Google OAuth access tokens start with `ya29.`, followed by letters, digits, hyphens or underscores. The length is not fixed, and Google has changed it over time:

```text
ya29.…XXXX   Google OAuth access token (masked)
```

The prefix is specific to Google’s OAuth access tokens, so a match is rarely a false alarm. The token usually appears in an HTTP request header, a JSON response or a configuration file, often beside a field called `access_token`. Refresh tokens are different. They do not start with `ya29.`, last much longer and are the more dangerous find, because they can produce new access tokens for months. If you see a refresh token or a client secret in the same file, handle it as part of the same incident.

## How Google OAuth Tokens get leaked

-   **Debug output.** A script that prints its HTTP responses or its token store, then gets committed or pasted into an issue.
-   **Command output saved to files.** A token printed by a command-line tool and redirected into a file in the project folder.
-   **Browser and mobile code.** A client-side app that holds the token in plain storage where anyone who downloads it can read it.
-   **Configuration files.** A tool’s token cache copied into a repository for a teammate, or left in a folder that was published.
-   **CI logs.** A pipeline step that echoes an authorization header while calling a Google API.

## What to do in the first hour

1.  **Remove the app’s access.** In your Google Account, open the page that lists third-party access, find the app that holds the token, and remove it. This invalidates the app’s refresh tokens, so it cannot mint new access tokens. An access token already issued keeps working until it expires, which usually takes about an hour.
2.  **Rotate the client secret** of the OAuth client in the Google Cloud console, if the leaked file held it. Then update the application with the new secret.
3.  **Check the token’s scopes and expiry.** LeakWatch and other tools can ask Google what a token is allowed to do and when it expires. If the scopes include mail, Drive or calendar access, treat the leak as a data exposure.
4.  **Review recent activity** in the services the scopes cover. For Gmail and Drive, look for messages sent, files shared or downloaded, and new filters or forwarding rules you did not create.
5.  **Check the Google Account** for new sign-ins, recovery details you did not set, and connected apps you do not recognize. Turn on two-step verification if it is not already active.
6.  **Look for other credentials** in the same file, especially refresh tokens, service account keys and API keys. See [I accidentally pushed an API key to GitHub](/blog/i-accidentally-pushed-an-api-key-to-github).
7.  **Clean the repository** and check the history for the token. Old commits keep the value, so removing access is the real fix. For a wider search, see [deep-scan your whole git history](/blog/deep-scan-your-whole-git-history).

Not sure what else leaked? [Run a free scan](/).

[Not sure what else leaked? Run a free scan.](/)

## Revoke it at Google

Access granted to third-party apps is listed on the third-party access page of your [Google Account](https://myaccount.google.com/permissions). Open it, choose the app that matches the leaked token, and remove its access. If the app belongs to a Google Workspace organization, an administrator may need to remove the grant from the admin console instead. Removing access ends the app’s ability to refresh its token. It does not change the access token itself, which expires on its own, so do not wait for the token to be refused before acting. The labels on Google’s pages change over time, so follow the wording on screen.

## How LeakWatch detects it

The rule is called “Google OAuth Token”. It looks for the literal prefix `ya29.` followed by one or more letters, digits, hyphens or underscores. There is no minimum or maximum length, because the length is not fixed, and no nearby word is needed. The prefix is specific enough to be reported on its own. The severity is **high**, with the impact class for identity and code access. **This type is checked live**: LeakWatch can check whether a detected token is still active with a read-only request that asks Google what the token allows and when it expires. It does not read your mail, files or calendar.

LeakWatch can check whether a detected key is still active with a read-only request to Google. It never reads your data or spends your credits.

## FAQ

The token expires in an hour. Do I still need to act?

Yes. The access token may already be expired when you find it, but the same file often holds something that lasts longer, such as a refresh token or a client secret. Those keep working until they are removed. Act on the whole file, not only the access token.

Will removing the app's access break my application?

Yes, the app will need the user to sign in again. Plan that for your own users. The short interruption is the cost of making sure the old refresh token stops working.

Is a Workspace account treated differently?

Yes. Google Workspace administrators can set policies on third-party apps and can remove grants for the whole organization. If the token belonged to a Workspace user, check the admin console as well as the personal account page.

## Related

-   [GCP Service Account Key](/secrets/gcp-service-account-key)
-   [Google API Key](/secrets/google-api-key)
-   [AWS access key](/secrets/aws-access-key)
-   [I accidentally pushed an API key to GitHub](/blog/i-accidentally-pushed-an-api-key-to-github)
-   [Which vendors leak most this week](/leaks/trends)
-   [All secret guides](/secrets)

[Get alerted next time a secret leaks — create a free account](/)

LeakWatch is not affiliated with Google.

![Gabriel Diyan, founder of LeakWatch](/brand/Photo-Gabriel-Diyan.webp)

Gabriel Diyan (0xCr0c0)

Cybersecurity student, founder of LeakWatch. I built and run the scanner described here — the detection patterns, the false-positive classifier and the provider validators are mine. [More about who I am](/about).

[GitHub](https://github.com/Leakwatch-Scan) · [X](https://x.com/LeakwatchScan) · [LinkedIn](https://www.linkedin.com/in/gabriel-diyan-80a378375) · [GitHub (personal)](https://github.com/crocogab)

LeakWatch

Secrets leak into public commits every minute. This watches the forges for yours. Built and run by [Gabriel Diyan](/about), a cybersecurity student — [why LeakWatch exists](/about).

Scan

-   [Product](/product)
-   [Live feed](/leaks)
-   [Trends](/leaks/trends)
-   [API docs](/docs)
-   [CI/CD](/docs?tab=ci)

Read

-   [Blog](/blog)
-   [Secret guides](/secrets)
-   [Changelog](/changelog)
-   [About](/about)

Verify

-   [Security](/security)
-   [Privacy](/privacy)
-   [Terms](/terms)
-   [Legal](/legal)
-   [Contact](/contact)
-   [Status](https://status.leakwatch.net)

© 2026 LeakWatch

[GitHub](https://github.com/Leakwatch-Scan)[X](https://x.com/LeakwatchScan)
