A Codecov token is what your CI pipeline uses to upload coverage reports to Codecov for a repository, and the same family of tokens is used to authenticate against the Codecov API. A leaked upload token lets a stranger push coverage reports into your project: they can distort your coverage numbers, make a pull request look better tested than it is, or flood the dashboard with junk. An API-capable token also exposes information about the repositories and commits linked to your account. It does not give write access to your source code, but it is a trust signal inside your review process, so treat it as a real secret. Replace the token first, then check what was uploaded while it was public.
Check your GitHub account for leaked secrets — free
- Provider
- Codecov
- Severity
- High
- Impact
- Source code and build access
- Checked live by LeakWatch
- No
What a Codecov Access Token looks like
Codecov repository upload tokens and global upload tokens are random strings of letters and digits. The rule in this guide targets a 32-character value made of lowercase letters and digits, written next to the word codecov:
CODECOV_TOKEN=xxxxxxxx… (32 characters, [a-z0-9], masked here)
The string alone is not distinctive, since it is just 32 random characters. What identifies it is context: a variable called CODECOV_TOKEN, a token: input on the Codecov GitHub Action, a codecov.yml file, or a -t argument of the Codecov uploader. Newer upload tokens may use another layout (for example a UUID), and those do not match this rule. A public repository on some CI providers can upload without any token, so a token you find in a public project is not automatically a leak of something that was ever secret. Tell the repository token (one repository) from the global upload token (all repositories of an owner), which is more serious.
How Codecov Access Tokens get leaked
- CI workflow files.
CODECOV_TOKENwritten in clear in a GitHub Actions, CircleCI, Travis or GitLab pipeline instead of a secret. - Committed
.envand shell scripts. A helper script that runscodecov -twith the token inline, committed with the repository. - Build logs. A verbose step that prints environment variables or the full uploader command line in a public log.
- Copied badges and README snippets. A coverage badge or upload example pasted with the token still in the URL or command.
- Forks and templates. A project template that shipped with a working token, then copied into dozens of repositories.
What to do in the first hour
- Regenerate the token. In Codecov, open the settings of the repository (or of the organization, for a global upload token) and generate a new value. See the revoke section below, and check the Codecov documentation for the current wording.
- Update your CI secret. Store the new value as a masked secret in your CI provider, named
CODECOV_TOKEN, and trigger a build to confirm uploads still work. - Review recent uploads. Look at the commit and upload history of the repository for reports you do not recognize: unexpected branches, commits that never existed in your repository, or sudden coverage jumps.
- Check the account. Review which repositories and organizations are linked, and who has access. Remove integrations you no longer use.
- Look at related tokens. A Codecov token often sits in the same file as other CI credentials. Rotate those too.
- Clean up the code. Remove the token from the files and from the history if needed, and move it to your CI secret store. See I accidentally pushed an API key to GitHub.
Not sure what else leaked from the same repository? Run a free scan.
Revoke it at Codecov
Codecov tokens are shown and managed in the Codecov web app, after you sign in with an account that has write access to the repository: the repository token is on the settings page of that repository, and a global upload token is in the settings of the account or organization. Open the Codecov settings and look for the section where the upload token is listed, then generate a replacement. A person has not confirmed the exact menu wording for this guide, and the interface can change, so follow Codecov’s documentation if the page differs. Once the token is replaced, the old value stops being useful, so update every pipeline that used it.
How LeakWatch detects it
The rule is called Codecov Access Token. It needs the word codecov (any letter case), then a short label of up to 20 characters, a separator such as =, : or =>, optional quotes, and a value of exactly 32 lowercase letters or digits followed by a quote, whitespace, a semicolon or the end of the line. A 32-character value without the word codecov nearby is not reported, and neither is a value that is too short. The severity is high. This type is not checked live: LeakWatch does not send any request to Codecov with the token it found.
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
Can someone steal my source code with a Codecov token?
No, the token does not grant read access to your repository on its own. It lets someone upload coverage data and read what Codecov stores about your project, which is why the main risk is misleading reports.
Do I need a token for a public repository?
Often not: on several CI providers public projects can upload without one. If your workflow still carries a token, it is safe to remove it when your setup allows tokenless uploads.
Is regenerating the token enough?
It stops further misuse of the old value. You should also review past uploads and update every pipeline that used the token, or builds will start failing.