# Leaked Gitea Access Token? Revoke It and Audit Repos

> Gitea access token pasted in a CI file or script? Delete it in your user settings, review repo and package activity and rotate CI secrets. Step-by-step.

Source: https://leakwatch.net/secrets/gitea-access-token

---

[LeakWatch](/)

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

1.  [Home](/)
2.  [Secrets](/secrets)
3.  Gitea Access Token

Code & CI · Secret guide

# Leaked Gitea Access Token: what to do in the first hour

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

A Gitea access token is a personal credential for a Gitea server, the self-hosted Git service. It lets a script, a CI job or a tool act as the user who created it, through the API and, depending on the scopes chosen, over Git. Whoever holds it can read the repositories that user can see, push commits, change repository settings and, if the scopes allow, manage packages. Because Gitea is usually run by the team or the company itself, a leaked token can reach internal code that is not visible anywhere else. Delete it first, then check what it did.

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

Provider

Gitea

Severity

High

Impact

Source code and build access

Checked live by LeakWatch

No

## What a Gitea Access Token looks like

Gitea access tokens are 40-character strings of hexadecimal digits. They have no vendor prefix, so a match depends on the name it is stored under, such as `GITEA_TOKEN`, `gitea_key` or a similar variable:

```text
GITEA_TOKEN="…XXXX"   Gitea access token in an environment file (masked)
```

Because the token has no prefix, the safest way to recognize one is by context. A forty-character hexadecimal string next to a Gitea name in a file that calls the Gitea API is a credential. The same kind of string next to a commit hash or a checksum is not. Gitea also lets a token be scoped to read or write access for repositories, packages, and other parts of the account, so the damage a leak can do depends on the scopes it was created with.

Do not confuse the access token with the password of the account. Changing the password does not, on its own, remove an existing token. Tokens have to be deleted one by one, which is also why they are easy to forget.

## How Gitea Access Tokens get leaked

-   **CI and runner configuration.** A pipeline file or runner configuration that contains the token in plain text, committed to the same repository the pipeline builds.
-   **Git remotes.** A remote URL with the token embedded in it, such as a clone command copied into a document or a script.
-   **Shell history and dotfiles.** A command typed with the token on the line, saved to a history file that is later backed up or shared.
-   **Build logs.** A job that prints its environment or the full clone URL, so the token lands in a log that many people can read.
-   **Shared mirrors.** A mirror or backup of the server that copies user settings, including tokens, to a location with broader access than the server itself.

## What to do in the first hour

1.  **Delete the token.** Open the Applications settings in your Gitea user account, find the token that leaked and delete it. Deleting a token revokes its access at once for every script and app that used it.
2.  **Review account activity.** Check the commits, pushes, branch changes and repository settings in the period since the token may have been exposed. Look for pushes you did not make, new deploy keys or webhooks, and changes to protected branches.
3.  **Check the other accounts.** If the token belonged to a service or bot account, check what that account can reach, and whether any other tokens were created from it.
4.  **Create a replacement** with the smallest scopes the job needs, and store it in your CI secret store or your secret manager. Do not place it in a remote URL.
5.  **Rotate the other secrets** that the same pipeline used, such as deploy keys, registry passwords and cloud credentials.
6.  **Clean the repository.** Remove the value from the current files and from the pipeline definition, and check the history for older copies. See [I accidentally pushed an API key to GitHub](/blog/i-accidentally-pushed-an-api-key-to-github).

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 Gitea

Personal access tokens in Gitea are listed under your user settings, in the Applications page. Find the token by its name, use the delete button next to it and confirm. Gitea’s documentation for access tokens is at [docs.gitea.com](https://docs.gitea.com/). For self-hosted servers, the administrator may also be able to review tokens and users from the administration panel, so ask them if you do not have that access. The exact labels depend on the Gitea version your server runs, and this guide could not confirm them for every version, so follow what your server’s Applications page shows.

## How LeakWatch detects it

The rule is called “Gitea Access Token”. It looks for a name that contains `gitea` followed by the words token, key, secret or access, close to an assignment such as an equals sign or a colon, and then a value of exactly forty hexadecimal characters in quotes or on its own. The name must come before the value and be close to it. A forty-character hexadecimal string with no Gitea name nearby is not reported. The severity is **high**, with the impact class for identity and code access. **This type is not checked live**: LeakWatch does not send the token to a Gitea server to see whether it works.

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

Is my Gitea server safe if only the token leaked?

Not automatically. The token can read and write whatever the user could reach, so review the activity before you decide. The server itself is not compromised by a leaked token, but the repositories the token could reach may be.

Can I rely on changing my password instead?

No. Existing tokens keep working after a password change, so each token must be deleted separately.

What scopes should a replacement token have?

Only the scopes the job needs. A pipeline that reads one repository does not need write access to every repository or package. Smaller scopes make the next leak less damaging.

## Related

-   [GitLab Personal Access Token](/secrets/gitlab-personal-access-token)
-   [GitHub Personal Access Token](/secrets/github-personal-access-token)
-   [CircleCI Personal Access Token](/secrets/circleci-personal-access-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 Gitea.

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