These write-ups are not threat intelligence and are not kept up to date as an incident develops. They are here to show how each attack worked, so you can find and fix the same techniques in your own setup. For the latest on an incident, read its sources.
Megalodon: mass backdooring of CI workflows
May 2026 · Contained
On 18 May 2026, probably with credentials taken from developers' machines by infostealers, someone pushed workflows that steal CI secrets and cloud credentials straight to the default branch of 5,561 repositories in about six hours, and left dormant workflow_dispatch backdoors in a few chosen ones.
- Way in
- Leaked token
- Access held
- Scale
- 5,718 commits to 5,561 repositories in about six hours
Full summary
Between about 11:36 and 17:48 UTC on 18 May 2026, 5,718 commits landed on the default branches of 5,561 public repositories, with no pull request. Git lets the pusher write any author, so the commits claimed to come from build-bot, auto-ci, ci-bot or pipeline-bot and said things like "ci: add build optimization step". SafeDep and Wiz read the pushes as made with compromised personal access tokens or deploy keys, and Hudson Rock found 331 of the 978 usernames involved in infostealer logs; how the credentials were taken is otherwise not established. Most repositories got a new .github/workflows/ci.yml named SysDiag that ran on every push and on pull_request_target, asked for id-token: write, and ran a base64-encoded bash script. The script collected environment variables, credential files, cloud keys from the AWS, GCP and Azure metadata services, secrets found in the workspace and the job's OIDC token request values, and posted them to 216.126.225.129:8443. In a smaller set, including nine Tiledesk repositories and eight of Black-Iron-Project, an existing workflow was replaced by one named Optimize-Build with the same script but only a workflow_dispatch trigger, so it did nothing until someone ran it. SafeDep found the campaign because Tiledesk's maintainer, without noticing, published seven npm versions from the poisoned repository; the npm account itself was not touched.
How it unfolded
Pick a step to zoom into it. A dashed line is a step the sources do not state. Blue dots are the checklist items that break the step.
Whole path
The whole attack, one row per step. Pick a step on the left, or click a box in its row.
SafeDep and Wiz say the commits were pushed with compromised personal access tokens or deploy keys, without showing which. Hudson Rock checked the 978 usernames tied to the affected repositories and found 331 of them on machines infected by infostealers, and concluded the access came from infostealer data. SafeDep also describes throwaway accounts with random eight-character names such as rkb8el9r. Which accounts did the pushing, and whose tokens they were, is not published.
What breaks this step
- Set an organization-wide maximum PAT lifetime (90 days is a reasonable default)
- Disable classic PATs organization-wide, forcing migration to fine-grained PATs
- Secret scanning and push protection enabled
- Set `persist-credentials: false` on actions/checkout wherever later steps do not push
- Require organization owner approval for fine-grained PATs.
- Never upload the checkout workspace as an artifact.
From about 11:36 to 17:48 UTC on 18 May 2026, 5,718 commits reached 5,561 repositories, directly on the default branch with no pull request and no merge commit. The author names were build-bot, auto-ci, ci-bot and pipeline-bot with made-up email addresses, and OX Security saw an author date hardcoded to 17 September 2001. On the Tiledesk commit the GitHub API linked no account to author or committer. Repositories without a ruleset requiring a pull request had nothing to stop it.
What breaks this step
- Branch protection on default/release branches: required reviews of the last push + required status checks
- Rulesets applied: push restriction, tag protection, sensitive file-path protection
- Require the committer to match the pusher on sensitive repos
- Require signed commits on the default branch of sensitive repos
The mass variant added .github/workflows/ci.yml named SysDiag, triggered on push to any branch and on pull_request_target, with id-token: write and actions: read. pull_request_target runs with the repository's secrets for a pull request from anyone, including a fork. Its base64 bash script read printenv and every readable /proc/*/environ, 27 credential files (AWS, SSH, Docker, npm, gcloud, gh, kubeconfig, Terraform, Vault, git credentials, shell history), the AWS, GCP and Azure metadata services, .env and service account files with 30 or more secret patterns, and ACTIONS_ID_TOKEN_REQUEST_URL and _TOKEN. It gzipped the result and posted it to 216.126.225.129:8443 tagged megalodon. StepSecurity's Harden-Runner blocked one such connection.
What breaks this step
- CODEOWNERS in place, required on sensitive paths
- Rulesets applied: push restriction, tag protection, sensitive file-path protection
- Inventory every Actions secret and its visibility/scope; the results are usually surprising
- Cloud credentials migrated from static keys to OIDC federation, scoped to repo + branch
- Put production secrets in environments with required reviewers
In the targeted variant, Optimize-Build, an existing workflow was replaced. In Tiledesk, commit acac5a9 swapped docker-community-worker-push-latest.yml's on: push for on: workflow_dispatch and its Docker build for the same script. Because the file already said workflow_dispatch when it landed, the push did not run it, and the Actions API showed no dispatch runs. It waits for anyone who can run workflows in the repository, such as the holder of the stolen token, to start it through the API.
Tiledesk's maintainer published @tiledesk/tiledesk-server 2.18.6 to 2.18.12 between 19 and 21 May from the backdoored repository, with the same npm account that published the clean 2.18.5. The only difference from 2.18.5 was the workflow file. SafeDep's scanner flagged that file in the package, which is how the campaign was found; the package does not run the payload on install.
OX Security published on 21 May with 3,500 or more repositories it had confirmed through the base64 string, SafeDep the same day with 5,718 commits from GitHub's commit search, StepSecurity on 22 May, Wiz's tracker on 22 May and Hudson Rock on 23 May. OX describes the commits as arriving by pull requests that an owner merges, which the commit data in SafeDep's analysis does not show. No source names an actor; SafeDep notes a resemblance to TeamPCP but thinks it is more likely a copycat.
Frameworks
Part of
Contained. First seen May 2026. How the attacker got in is not confirmed. 5,718 commits to 5,561 repositories in about six hours (as of 21 May 2026, source). Mapping by ghtier, not yet reviewed. Threat landscape
Sources
- researchMegalodon: mass GitHub repo backdooring via CI workflows
- trackerMegalodon campaign backdoors GitHub repositories via CI workflow compromise (Wiz Cloud Threat Landscape)
- researchMegalodon: mass GitHub Actions secret exfiltration across 5,500 public repositories
- researchMegalodon: new CI/CD malware spreads across GitHub
- researchInfostealers just spawned a 5,000+ repo GitHub supply chain attack
- trackerMegalodon: mass CI/CD pipeline poisoning via GitHub Actions (CSA research note)
Reported by: SafeDep, StepSecurity