How to fix: GitLab runner registration token in source
Runner registration tokens allow anyone to attach a malicious runner and exfiltrate CI secrets and source from every job.
Why it matters
An exposed runner registration token allows an attacker to register a malicious runner that intercepts CI/CD jobs, stealing all CI environment variables, source code, deploy keys, and any secrets passed to pipelines. This is a complete CI/CD supply-chain compromise.
Runner registration tokens allow anyone to attach a malicious runner and exfiltrate CI secrets and source from every job.
How to fix it
- 1Rotate the registration token immediately in GitLab → Admin → Runners or Project → Settings → CI/CD
- 2Unregister all unknown runners and audit recently registered ones
- 3Switch to the new runner authentication token workflow (group-runner auth tokens)
Code examples
Rotate runner registration token via API
# Reset the registration token for a project
curl --request POST \
--header 'PRIVATE-TOKEN: YOUR_ADMIN_TOKEN' \
'https://gitlab.example.com/api/v4/projects/PROJECT_ID/runners/reset_registration_token'
# List all registered runners to find unauthorized ones
curl --header 'PRIVATE-TOKEN: YOUR_ADMIN_TOKEN' \
'https://gitlab.example.com/api/v4/runners/all?status=online'References
Detected automatically by VulnRadar. The check id is secret-gitlab-runner-registration, stable across every scan so you can filter or diff on it.
More secrets checks
Questions
- How severe is GitLab runner registration token in source?
- VulnRadar rates this critical severity in the secrets category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
- Does VulnRadar check for this automatically?
- Yes. It runs as part of every scan under the check id secret-gitlab-runner-registration, which stays the same between runs so you can filter, diff, or gate CI on it.
- Which standards does GitLab runner registration token in source map to?
- It maps to CWE-798. In the OWASP Top 10 it falls under A07:2021.
Missing a check?
The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.