Sunday, October 18, 2026

GitLab Email Token Lets Attackers Push Code to Main and Execute CI/CD Jobs

A long-lived GitLab incoming email token embedded in project email addresses for the “Email work item” feature can be exploited to push attacker-controlled code, create merge requests, and trigger CI/CD pipelines using the permissions of the token owner.

This issue can also bypass GitLab’s IP restrictions, as incoming email is explicitly excluded from those controls.

Security researcher Joe Leon from Aikido Security reported that GitLab’s private email addresses, which are intended to allow users to create issues by email, contain a credential that functions more like an account-wide, fine-grained access token than a project-scoped mail address.

The token does not expire and is reused across all projects accessible to the account, including private repositories.

GitLab Email Token Flaw

GitLab exposes a private email address through the “Email work item to this project” option. The address typically follows this format:

`incoming+project-id-glimt-<token>[email protected]`

While the interface historically described the address as a means to create project work items, the embedded glimt-incoming email token authenticates requests as the account owner.

GitLab’s documentation confirms that this incoming email token does not expire and that anyone who obtains it can create issues and merge requests as the associated user.

Account-wide access (Source: Aikido)
Account-wide access (Source: Aikido)

Aikido found that the token portion remains identical when a user retrieves project email addresses from multiple repositories. This means a token leaked from a public project’s README, support page, documentation, or issue template could potentially be used against other projects accessible to the same account.

The reported attack chain relies on GitLab’s merge-request-by-email workflow. An attacker who knows the target email address can modify the `-issue` suffix to `-merge-request`, submit a specially crafted email, and attach a Git patch file.

The email’s subject can specify a target source branch. GitLab will apply the supplied patch to that branch or create the branch if it does not already exist, using the victim’s permissions. If the compromised account has permission to push to protected branches, the attacker may be able to make commits directly to the main branch.

The risk increases significantly if the patch modifies the `.gitlab-ci.yml` file. If the victim’s role and pipeline settings allow it, GitLab can execute an attacker-defined CI/CD job in the target project.

This job might be utilized to access repository contents, retrieve CI/CD variables, extract secrets, or leverage the CI_JOB_TOKEN for additional access within the GitLab environment.

Aikido tested this behavior against a private project configured with an IP allowlist that excluded their address. GitLab blocked browser access and denied Git clone attempts; however, it accepted the merge request email, allowing the resulting commit to land on the main branch.

Screenshot of the personal access token page taken (Source: Aikido)
Screenshot of the personal access token page taken (Source: Aikido)

GitLab’s documentation now states that users can create issues and merge requests via email because incoming email does not fall under IP restrictions. Therefore, organizations should not consider GitLab IP allowlists as a comprehensive solution for repository modification workflows.

The attack does have limitations. The email token inherits the affected user’s existing permissions so that a low-privilege account would have less impact than a Maintainer or Owner account.

Additionally, attackers must know the intended project’s routing details, including its project path and ID. While these details are easy to obtain for public projects, private ones may require additional information leaks.

Organizations should treat GitLab incoming email addresses as sensitive information, not regular contact addresses.

  • Immediately reset incoming email tokens if an address has been exposed, published, or suspected to have leaked. GitLab allows token resets under user profile settings and personal access tokens; resetting invalidates the associated incoming email addresses.
  • Search through source repositories, documentation, wiki pages, issue templates, and public websites for glimt tokens and GitLab incoming email address patterns.
  • Review users with Maintainer, Owner, and protected-branch push permissions, as their leaked tokens could lead to significant exposure.
  • Audit CI/CD configurations for overly broad secret access, unrestricted pipelines, and excessive CI_JOB_TOKEN permissions.
  • Treat IP allowlists as a layered control and not as sufficient protection against incoming email workflows.
  • Monitor GitLab audit events, merge requests, branch creation, pipeline execution, and changes to `.gitlab-ci.yml` for unusual email-originated activity.

GitLab has updated its user interface and documentation following this disclosure to clarify that incoming email addresses can create both issues and merge requests.

GitLab also removed language suggesting the token could not access other data. However, the underlying mechanism remains unchanged, and GitLab’s documentation still states that the token does not expire and must be kept confidential.

Cut every SOC alert investigation by 21 min. Power your SOC with instant IOC context for immediate response: Integrate TI Lookup in your SOC

Divya
Divya
Divya is a Senior Journalist at GBhackers covering Cyber Attacks, Threats, Breaches, Vulnerabilities and other happenings in the cyber world.

Hot this week

How To Access Dark Web Anonymously and know its Secretive and Mysterious Activities

What is Deep Web The deep web, invisible web, or...

How to Build and Run a Security Operations Center (SOC Guide) – 2023

Today’s Cyber security operations center (CSOC) should have everything...

Russian Hackers Bypass EDR to Deliver a Weaponized TeamViewer Component

TeamViewer's popularity and remote access capabilities make it an...

Web Server Penetration Testing Checklist – 2026

Web server pentesting is performed under three significant categories: identity,...

ATM Penetration Testing – Advanced Testing Methods to Find The Vulnerabilities

ATM Penetration testing, Hackers have found different approaches to...

Hackers Use ConnectWise SkyKick Credentials to Access Microsoft 365, Halting Cloud Backups

Attackers abused compromised ConnectWise Cloud Backup credentials to access...

Anthropic’s Claude AI Uncovers Origins of NSA-Provided Cryptographic Keys After 25 Years

Anthropic says an internal Claude research model reconstructed how...

OpenBSD Kernel Flaw Dating Back 37 Years Enables Local Privilege Escalation to Root

A newly disclosed OpenBSD kernel exploitation chain combines a...

GhostAction Hackers Hide Credential-Stealing Malware in Fake Font Files Across 94 GitHub Repositories

GhostAction attackers have expanded their GitHub credential theft campaign...

SideCopy Hackers Target Indian Organizations With ReverseRAT Malware to Steal Data

Indian authorities have warned that SideCopy hackers are targeting...

New GhostBat Android Malware Targets 60 Banking and UPI Apps to Steal PINs

A new GhostBat RAT variant targets 60 Android financial...

New ROMULUS Malware Platform Uses Six Servers to Deliver Multiple Malicious Payloads

ROMULUS, a shared ClickFix delivery platform operating across six...

Related Articles

Recent News