Gheist Campaign Exploits Stolen GitHub Tokens to Target Repository Secrets
Wiz Research uncovered Gheist, a campaign abusing stolen GitHub tokens to steal repository secrets through malicious workflows. Researchers found over 13,500 malicious branches across 850+ compromised accounts, with GitHub protections disrupting attacks in public repositories.
Xcademia Team

A cyber campaign called Gheist is exploiting compromised GitHub access tokens to steal sensitive credentials from software repositories, including private enterprise environments. Rather than relying on a separate command-and-control server, the campaign uses GitHub's own workflow infrastructure and APIs to execute malicious code, retrieve workflow logs and remove evidence of its activity.
Wiz Research began tracking the campaign on 15 September 2026. In its report published on 25 October, the security research team said it had recovered more than 13,500 malicious branches associated with over 850 compromised accounts. The affected accounts ranged from individual developers to organisations with private repositories.

Although a GitHub security control has prevented the observed malicious workflows from executing in public repositories, Wiz reported successful activity in private repositories and GitHub Enterprise Server environments. The campaign remained active and continued to evolve as of 24 October 2026.
The findings highlight an important software supply chain security risk: legitimate developer credentials can give attackers a route into repositories, automated build systems and connected cloud environments.
How the Gheist attack works
Gheist abuses existing access rather than relying on a newly discovered vulnerability in GitHub itself. The campaign uses compromised tokens to create branches and introduce malicious GitHub Actions workflow files into repositories the tokens can access.
The workflow is designed to expose repository secrets in its logs. The attacker then retrieves those logs through the GitHub API and deletes the workflow run shortly afterwards.
Wiz identified the gheist user agent in the campaign's API requests, which is how the activity received its name.
The observed attack follows a series of steps:
Compromised token access: The attacker obtains a GitHub token belonging to a developer or automation account.
Malicious branch creation: The tool creates a branch beginning with
ci-sync-, followed by six characters.Workflow injection: A file named
.github/workflows/sync-check.ymlis added with the commit messageci: sync config.Secret collection: The workflow attempts to print repository and environment secrets into its execution logs.
Log retrieval: The attacker downloads the logs through the GitHub API.
Evidence removal: The workflow run is deleted shortly after completion.
The approach is difficult to detect through traditional network monitoring alone because the campaign uses GitHub's own API for retrieving the exposed data. Security teams therefore need to examine repository changes, workflow activity, audit logs and connected cloud activity rather than relying only on suspicious outbound network connections.

Why encoded secrets can bypass log masking
A key detail in the reported attack is the way the malicious workflow handles sensitive information.
GitHub Actions can mask recognised secret values in logs. However, Wiz found that the campaign encoded secrets using Base32 before printing them. Because the encoded output no longer matches the original secret value, the usual masking behaviour may not recognise it.
The workflow also references the secrets context directly. Setting permissions: {} restricts the workflow's GITHUB_TOKEN permissions, but it does not, by itself, prevent access to secrets made available to that workflow.
The campaign's later variants also attempted to access environment-scoped secrets by including deployment environments in a job matrix. Such secrets may include credentials used in production deployments.
This distinction matters for developers and security teams: restricting a workflow's API token permissions is not the same as restricting which secrets the workflow can access.
Organisations should review which secrets are exposed to workflows triggered by branch pushes, particularly when untrusted or unexpected changes can initiate automated jobs.
From repository secrets to cloud infrastructure
The risk extends beyond the source code repository.
Wiz observed the campaign cycling through tokens belonging to multiple users and automation accounts within enterprise organisations. The attackers also cloned private repositories before inserting malicious workflows.
In some investigated cases, cloud credentials from the same organisation were subsequently used to enumerate AWS Secrets Manager. Wiz also documented a later variant designed to search self-hosted runner environments for sensitive files and credentials.
These findings demonstrate how a compromised developer token can become an entry point into a broader environment when repository workflows have access to cloud identities or other credentials.
The potential exposure depends on the permissions of the compromised token, the secrets available to affected workflows, and the access granted to connected infrastructure. The report does not establish that every compromised account resulted in a complete cloud compromise.
How the campaign evolved
Wiz identified two variants operating in parallel. The first used a comparatively straightforward secret-dumping workflow, while the second introduced additional behaviour over time.
The second variant added a six-minute execution timeout and environment-aware secret collection within hours of its first observed run on 28 September 2026. On 19 October, it added a separator to the output and introduced a second job named sync-host, apparently targeting repositories with registered self-hosted runners.
According to Wiz, the self-hosted variant attempted to search several locations for credentials and sensitive data, including:
Developer home directories, workspaces and system paths.
Private keys,
.envfiles, Terraform state and shell history.Process environment variables.
AWS instance-role credentials and cloud metadata endpoints.
GitHub Actions and GitLab runner credential files.
Kubernetes service account tokens.
Tokens associated with AI service providers, including Anthropic, Hugging Face, Groq and NVIDIA.
The variant also attempted to use the Docker socket to access the host filesystem from a container.
Wiz noted that this job contained implementation errors. Its analysis found problems with runner credential discovery and URL credential matching, and reported that the observed variant did not collect GCP or Azure tokens as intended. These limitations describe the analysed payload, not a guarantee that future versions will behave the same way.

GitHub's public repository protection disrupted the attack
One of the most significant findings concerns a GitHub control introduced on 28 July 2026.
According to Wiz, GitHub began holding potentially malicious workflow runs in public repositories until a collaborator approves them. In the public Gheist runs examined by the researchers, the workflows remained in an action_required state, meaning the malicious payloads did not execute.
However, Wiz reported that this approval hold did not apply to private repositories or GitHub Enterprise Server in the environments it investigated. There, audit logs showed workflows on ci-sync-* branches completing before the runs were deleted. AWS CloudTrail records also showed workflows on attacker-created branches assuming AWS roles.
The distinction is important for organisations that rely on GitHub for private software development. A protection that prevents execution in public repositories does not automatically provide equivalent protection across every repository type or enterprise deployment.
The incident also illustrates why security teams should validate controls against their actual repository configuration instead of assuming that a platform-wide safeguard covers every environment.
Related malicious activity involving compromised accounts
Wiz also found evidence that some accounts associated with Gheist overlapped with other suspicious campaigns. The research described several related activities:
Malware distribution: On 6 October, 391 accounts renamed approximately 1,461 repositories to names associated with cracked software and other lures.
Cryptomining attempts: On 18 October, 25 Gheist-associated accounts created repositories named
Windows RDP Runnerwithin a nine-minute period, apparently to abuse GitHub Actions compute resources.PolinRider activity: Some investigated victims appeared to have been affected by malware that hides JavaScript in build configuration files and manipulates Git history.
Megalodon overlap: Wiz reported that 57 accounts from Gheist's first phase had also been victims of Megalodon in May.
The researchers traced some credential sources to infostealer logs and tokens exposed during earlier supply chain compromises, including the Trivy compromise in March. They also explicitly distinguished
Gheist from GhostAction, which uses different workflow files and a separate exfiltration destination.
These overlaps suggest that stolen developer credentials can be reused across different malicious operations. However, shared accounts do not necessarily establish that all the campaigns were conducted by the same operator.
What security teams should investigate
Wiz recommends hunting for specific repository, workflow and cloud audit indicators rather than relying on a single detection method.
Gheist detection checklist
Indicators documented by Wiz Research
Unexpected branches
Look for branch names matching ^ci-sync-[0-9a-z]{6}$, especially when the branch only introduces .github/workflows/sync-check.yml.
Suspicious commits
Investigate the commit message ci: sync config and unexpected changes to workflow files.
Short-lived workflow runs
Review GitHub audit logs for runs on ci-sync-* branches that complete and are deleted within a minute, and for activity using the gheist user agent.
Unexpected cloud role assumptions
If workflows use OpenID Connect (OIDC), inspect cloud audit logs for role assumptions or token exchanges associated with ci-sync- branches.
Self-hosted runner artefacts
Search for .gdmp_pat, .gdmp_patg, .gdmp_sweep and the gdmp-pivot marker in relevant files and job logs.
A particularly useful finding is that cloud audit records can help identify the campaign even when GitHub logs are unavailable. A cloud role assumption associated with an attacker-created branch can provide evidence that a malicious workflow executed.
Security teams should correlate these signals with repository events, workflow execution records, identity logs and cloud activity. Individual indicators require investigation because a branch name or workflow deletion, considered alone, is not conclusive proof of compromise.
Recommended response and prevention measures
If an organisation confirms that a repository was affected, deleting the malicious branch or workflow run is not enough. Any secrets printed into workflow logs should be treated as potentially exposed.
Wiz recommends the following response measures.
Rotate exposed secrets. Replace repository, organisation and environment secrets accessible to affected repositories.
Revoke compromised tokens. Identify and revoke the tokens used to push the malicious commits. Investigate the associated account owners' devices for possible infostealer infections.
Assess self-hosted runners. If a
ci-syncbranch executed on a self-hosted runner, treat the host and its instance role as compromised and investigate accordingly.Do not approve suspicious workflows. Keep unexpected
sync-checkruns on hold and do not execute code from suspiciousci-syncbranches.Review cloud identity activity. Examine cloud audit logs for unusual role assumptions or token exchanges associated with affected workflows.
Longer-term prevention requires tighter control over workflow execution and credential access.
Organisations should require reviewers for deployment environments containing production secrets, scope OIDC trust policies to protected branches or approved environments, and favour GitHub Apps or short-lived fine-grained tokens over broadly scoped personal access tokens where appropriate.
Self-hosted runners should also be designed to minimise the impact of a compromise. Wiz recommends using ephemeral hosts and avoiding unnecessary Docker socket access or unrestricted access to instance metadata.
These measures reduce the opportunities for a stolen token to become a route into production credentials and connected infrastructure.
What the incident means for software security
The Gheist campaign highlights a broader industry shift toward attacks that exploit trusted developer identities and automated software delivery systems rather than relying exclusively on traditional network intrusion techniques.
For enterprises, this means repository security must extend beyond protecting source code. Access tokens, workflow permissions, environment secrets, cloud identities and self-hosted build infrastructure all form part of the security boundary.
The campaign also reinforces the importance of monitoring activity across systems. A repository change may appear routine in isolation, but a suspicious workflow followed by rapid deletion and an unexpected cloud role assumption can reveal a much more serious sequence of events.
The key lesson is that compromised credentials should be treated as a potential entry point into the wider development and cloud environment. Effective defence requires careful permission management, reliable audit trails and a coordinated incident response process.
Wiz's report provides concrete indicators that security teams can use to investigate potential exposure and strengthen their GitHub Actions security controls.
Source: Wiz Research
About the Author