# Leaked GitHub Refresh Token? Revoke the App Access

> GitHub refresh token exposed in a repo or log? Revoke the app's authorization in GitHub settings, rotate the app secret and review access.

Source: https://leakwatch.net/secrets/github-refresh-token

---

[LeakWatch](/)

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

1.  [Home](/)
2.  [Secrets](/secrets)
3.  GitHub Refresh Token

Code & CI · Secret guide

# Leaked GitHub Refresh Token: what to do in the first hour

Critical severityDetected onlyLast verified November 5, 2026 · 5 min read

A GitHub refresh token is issued to a GitHub App when it acts on behalf of a user and the app uses expiring user tokens. The refresh token is used to obtain a new user access token once the old one has expired, and each use returns a new refresh token. Whoever holds a refresh token can keep generating access tokens for that user’s grant, which means they can act as the user for the repositories and organizations that the app was authorized to reach. That can last a long time, which is why this is a critical credential. Revoke the app’s authorization first, then review what it did while the token was exposed.

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

Provider

GitHub

Severity

Critical

Impact

Source code and build access

Checked live by LeakWatch

No

Revoke at

[GitHub](https://github.com/settings/applications)

## What a GitHub Refresh Token looks like

GitHub refresh tokens begin with `ghr_`, followed by a long run of letters and digits. The prefix separates them from the other user tokens GitHub issues:

```text
ghr_…XXXX   GitHub refresh token (masked)
```

The `ghu_` prefix belongs to the user access token that the refresh token replaces, and a personal access token uses its own prefix. A refresh token is worth more than the access token it produces, because it can produce new access tokens. If you see a `ghr_` value in a file, log or message, treat the user’s grant as compromised until you have revoked it. The refresh token is typically stored by the application’s backend, so a leak often points to a server-side configuration or a database dump rather than to a developer’s laptop.

## How GitHub Refresh Tokens get leaked

-   **Application databases and dumps.** A backup or a database export that holds the stored tokens for each user, copied to a place with weaker access.
-   **Configuration and environment files.** A file that stores the tokens for a bot or a tool, pushed to a repository.
-   **Logs.** A token-exchange step that logs the full response, including the refresh token, when a sign-in fails.
-   **Debugging tools.** A captured request or a debugging proxy session that records the token response and is shared with others.
-   **Shared support requests.** A token pasted into a ticket when an integration stopped working.

## What to do in the first hour

1.  **Revoke the app’s authorization.** Sign in to the GitHub account that granted the app, open its [account settings](https://github.com/settings/applications), and revoke the app’s authorization. This ends the grant, so the refresh token can no longer produce new access tokens.
2.  **Rotate the app’s client secret** in the GitHub App settings, because a leaked refresh token can come with a leaked client secret from the same server. Update the application to use the new secret.
3.  **Review the account’s activity.** Check the security log of the affected user and the organizations the app could reach. Look for repository changes, new keys, new workflows and webhook changes made during the exposure.
4.  **Check the app’s installations.** Review the installations of the GitHub App on each organization, and remove any installation you do not recognize.
5.  **Check for new credentials.** Look for new deploy keys, personal access tokens and SSH keys added to the account while the token was exposed, and remove those you did not create.
6.  **Rotate the rest of the stored data.** If the token was in a database dump, assume other stored values were read too, and rotate them.
7.  **Clean the repository.** Remove the value from current files and logs, add the configuration to `.gitignore`, and rewrite history if the repository was public. See [I accidentally pushed an API key to GitHub](/blog/i-accidentally-pushed-an-api-key-to-github) for the full order.

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

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

## Revoke it at GitHub

Revoking a grant is done from the GitHub account settings, in the Applications area, under the list of authorized GitHub Apps. Find the app, open it, and revoke its access. The app will then need the user to authorize it again before it can act for them. Revoking is the step that makes a stolen refresh token useless, so it comes before the code cleanup. GitHub’s documentation on refreshing user access tokens explains that a refresh token is used once, after which the old token and the old access token stop working. That rotation does not replace a revocation, because an attacker who uses the token first will get a fresh pair. Revoking the grant and rotating the app’s client secret together is the reliable response.

## How LeakWatch detects it

The rule is called “GitHub Refresh Token”. It looks for the prefix `ghr_` followed by between 76 and 1024 letters or digits, with no word boundary check. A shorter value after the prefix is not reported. The severity is **critical**, with the identity and code impact class, because the token can produce access to the user’s repositories for as long as the grant lasts. **This type is not checked live**: LeakWatch does not send the value to GitHub, so a finding means a value with the right shape was seen, not that it is still valid. The rule file gives the GitHub account settings page as the revocation location, and that is the path this guide follows.

LeakWatch detects this format but does **not** check it live: it can tell you the key is exposed, not whether it still works. Assume it does until you have revoked it.

## FAQ

If I revoke the access token, is the refresh token still a problem?

Yes. The refresh token can produce a new access token, so revoking only the access token leaves the grant in place. Revoke the app’s authorization, which covers the refresh token as well.

Does rotating the client secret also revoke the refresh token?

Not by itself. The client secret is used to exchange and refresh tokens, so rotating it stops the application from refreshing with the old secret, but the grant still exists until you revoke it in the account settings. Do both.

What if the app is used by many people?

Each user has their own grant, so you may need to revoke several. Review the list of authorized apps for each affected account, and ask the users to sign in again after the app is repaired.

## Related

-   [GitHub OAuth Access Token](/secrets/github-oauth-access-token)
-   [GitHub Personal Access Token](/secrets/github-personal-access-token)
-   [Claude OAuth Refresh Token](/secrets/claude-oauth-refresh-token)
-   [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 GitHub.

![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)
