Skip to content
Code & CI · Secret guide

Leaked GitLab Pipeline Trigger Token: what to do in the first hour

High severityDetected onlyLast verified · 5 min read

A GitLab pipeline trigger token lets whoever holds it start a pipeline in one project through the REST API or a webhook URL, without signing in as a user. The caller picks the branch or tag and can pass variables, so the main danger is arbitrary code running in your CI context: on your runners, with the project’s CI/CD variables, deploy keys and cloud credentials in reach. The token does not give general access to the repository, which is why it is a smaller exposure than a personal access token, but a pipeline is still a way to execute code. Revoke the token first, then investigate what ran.

Check your GitHub account for leaked secrets — free

Provider
GitLab
Severity
High
Impact
Source code and build access
Checked live by LeakWatch
No

What a GitLab Pipeline Trigger Token looks like

A trigger token starts with a fixed prefix, followed by 40 lowercase hexadecimal characters:

glptt-XXXXXXXX…   GitLab pipeline trigger token (masked, 6-character prefix + 40 hex characters)

Older tokens were created before the prefix existed and are plain 32-character hexadecimal strings, so a bare hex value in a CI file may also be a trigger token. The prefix glptt- is easy to confuse with glpat-, which is a personal access token and a far more powerful credential. Look at the third and fourth letters before deciding which guide applies. A token usually appears in a variable such as GITLAB_TRIGGER_TOKEN or TRIGGER_TOKEN, as the token= parameter of a call to /api/v4/projects/<id>/trigger/pipeline, or inside a webhook URL ending in /ref/<branch>/trigger/pipeline?token=.

How GitLab Pipeline Trigger Tokens get leaked

  • Cross-project triggers in pipeline files. One project starts a downstream one, and the token is written in .gitlab-ci.yml instead of a masked CI/CD variable.
  • Webhook URLs. A trigger URL with token= in the query string is pasted into another service, a chat message or a README, and ends up in logs and history.
  • Deployment scripts. A curl call in a shell script or Makefile that kicks off a deploy pipeline, committed with the token.
  • Third-party integrations. The token is copied into a monitoring tool, a Git mirror or an external scheduler, then exported in its configuration.
  • Job logs. A debug option prints the request, and the log is public or shared with a wide audience.

What to do in the first hour

  1. Delete the token. In the project, open the CI/CD settings and the section that lists pipeline trigger tokens, then revoke the exposed one. See the revocation section below.
  2. Create a new token if the integration is still needed, and store it as a masked and protected CI/CD variable or in your secret manager. Update every caller.
  3. List the pipelines it started. In the project’s pipeline list, look for runs whose source is a trigger or an API call, outside the times you expect. Open their jobs and read the logs.
  4. Check the variables passed. A caller can override variables for a run. Look for unexpected values, different target environments, or jobs that behave in a way your normal pipeline does not.
  5. Rotate what those pipelines could read. If a suspicious run happened, treat the project’s CI/CD variables, deploy keys and cloud credentials as exposed, and rotate them.
  6. Check outputs. Review artifacts, package registry entries, container images and deployments created since the exposure.
  7. Clean up the code and search the history for other secrets. See 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 GitLab

Trigger tokens belong to a project and are managed in its CI/CD settings, in the section where pipeline trigger tokens are listed. You need the Maintainer role or higher to see and remove them. Use the GitLab project settings after signing in, open the project, and remove the exposed token from that list. Deleting a token stops it working, so any scheduler or downstream project that used it will fail until you give it the new value. A person has not confirmed the exact menu wording for this guide, and GitLab moves settings between releases, so if the page differs, look for the section where pipeline trigger tokens are shown, and follow the GitLab documentation.

How LeakWatch detects it

The rule is called GitLab Pipeline Trigger Token. It looks for the literal prefix glptt- followed by exactly 40 hexadecimal characters (0-9, a-f, lowercase), with a word boundary on both sides. A value with 39 characters, or one that runs on past 40 hexadecimal characters, is refused, and so is a glpat- token, which belongs to a different rule. The legacy 32-character tokens without a prefix are not reported, because a bare hexadecimal string is too common to match safely. The severity is high. This type is not checked live: LeakWatch does not send any request to GitLab 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 read my source code with a trigger token?

Not directly. The token only starts pipelines. But a pipeline runs code in your project’s context, so a run started with a leaked token can still reach secrets and outputs, which is why you review the runs.

Does deleting the token stop pipelines that are already running?

No. Deleting prevents new triggers. Cancel any suspicious running pipeline yourself from the pipeline page, and then read its logs.

Is a trigger token the same as a CI/CD job token?

No. A job token is created automatically for each job and expires when it finishes. A trigger token is created by a person, stays valid until deleted, and is meant for starting pipelines from outside.

Get alerted next time a secret leaks — create a free account

LeakWatch is not affiliated with GitLab.