# Leaked SonarQube Token? Revoke It Now

> SonarQube token exposed on GitHub? Revoke it in your account security page and review projects and analysis activity. Step-by-step guide.

Source: https://leakwatch.net/secrets/sonarqube-token

---

[LeakWatch](/)

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

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

Code & CI · Secret guide

# Leaked SonarQube Token: what to do in the first hour

High severityDetected onlyLast verified October 30, 2026 · 4 min read

A SonarQube token authenticates scanners, IDE plugins and scripts against your SonarQube server. According to the SonarQube documentation, a user token carries all the permissions of the user who generated it, while a project analysis token is limited to running analyses on a project. A leaked user token can therefore read project data, code quality findings and security hotspots, and may change settings, depending on that user’s rights. Findings about unfixed vulnerabilities are valuable to an attacker looking for a weak spot. Revoke the token first, then check what the account did.

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

Provider

SonarQube

Severity

High

Impact

Source code and build access

Checked live by LeakWatch

No

<!--live-stats-->

**Seen in the wild.** In the 30 days to 11 November 2026, LeakWatch detected 14 exposed SonarQube Token credentials in public code. These counts cover only what LeakWatch's rules detect. See [live leak trends](/leaks/trends).

<!--/live-stats-->

## What a SonarQube Token looks like

Recent SonarQube versions give tokens a prefix that says what they are: `squ_` for a user token, `sqp_` for a project analysis token and `sqa_` for a global analysis token. The body is 40 characters. Older tokens have no prefix and are just 40 characters of lowercase letters and digits:

```text
sonar.token=sqp_XXXXXXXX…   (prefix + 40 characters, masked here)
SONAR_TOKEN=XXXXXXXX…       (older tokens, 40 characters, no prefix)
```

Typical places: the `sonar.token` property (or the older `sonar.login`) in `sonar-project.properties`, the `SONAR_TOKEN` environment variable, the `-Dsonar.token=` argument of a scanner, or a Maven, Gradle or CI configuration. Tell a user token from an analysis token by its prefix: the user token is the broader one, so handle it first if both appear.

## How SonarQube Tokens get leaked

-   **Scanner configuration.** `sonar-project.properties` committed with `sonar.token` or `sonar.login` filled in.
-   **Build files.** A Maven or Gradle file with the `-Dsonar.token` argument written inline.
-   **CI pipelines.** A workflow file or log containing `SONAR_TOKEN` instead of a protected secret.
-   **Dockerfiles and scripts.** A setup script that runs the scanner with the token on the command line, visible in shell history or logs.
-   **IDE settings.** A connected-mode configuration shared in a repository or a screenshot.

## What to do in the first hour

1.  **Revoke the token.** Sign in to SonarQube as the owner of the token and delete it from your account security page, described below. An administrator can also revoke tokens for other users.
2.  **Create a replacement** with the narrowest type that works. Prefer a project analysis token for CI, and set an expiry date if your version allows it.
3.  **Update your pipelines** and secret stores, then run an analysis to confirm it passes.
4.  **Review account activity.** Check which projects the user can access, and look in the administration area for audit information if your edition provides it. Look for changes to quality gates, permissions, webhooks and settings you did not make.
5.  **Check webhooks and integrations.** A webhook added by an attacker can send analysis results to an outside server. Remove any you do not recognize.
6.  **Review exposed findings.** If the attacker could read security hotspots, plan fixes for the serious ones.
7.  **Clean up the code** and the history. 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 SonarQube

On SonarQube Server and Community Build, the documentation says tokens are listed in your account menu, under My Account and then Security, where each token has a Revoke action. SonarQube Cloud has a similar page under your account for personal access tokens. SonarQube is often self-hosted, so there is no single console address for everyone: use the SonarQube security page of your own instance or of the cloud service. A person has not confirmed the exact menu wording for this guide, and the interface can change, so look for the section where your tokens are listed and follow the [SonarQube documentation](https://docs.sonarsource.com/sonarqube-server/user-guide/managing-tokens). Revoked tokens stop working for new requests.

## How LeakWatch detects it

The rule is called SonarQube API Token. It looks for the property name `sonar.login`, `sonar.token`, `sonar_token` or a close variant (separator `_`, `.`, `-` or none), then a separator such as `=`, `:` or `=>`, optional quotes, and a value of exactly 40 characters from letters, digits, `=`, `_` and `-`, which may start with `squ_`, `sqp_` or `sqa_`. A 40-character string without the property name next to it is not reported, and neither is a shorter value. The severity is **high**. This type is not checked live: LeakWatch does not send any request to your SonarQube server 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

What is the difference between a user token and an analysis token?

A user token acts as the person who created it, with all that person’s permissions. An analysis token is restricted to running analyses, so it does much less damage if exposed.

Can the token reach my source code?

SonarQube stores code snippets next to its findings, so someone with read access can see parts of your code. It is not a Git credential, so it does not clone your repository.

Do I need to rotate the token if my server is private?

Yes if the server can be reached from the internet or from a network the attacker can enter. If it is only reachable inside a closed network, the risk is lower, but a leaked token is still best replaced.

## Related

-   [Snyk API Token](/secrets/snyk-api-token)
-   [Atlassian API Token](/secrets/atlassian-api-token)
-   [GitLab Personal Access Token](/secrets/gitlab-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 SonarQube.

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