Join our Newsletter — 33% off our NHI Course

GitHub Actions secret theft at scale: what IAM teams missed

 

(@nhi-mgmt-group)
Member Moderator
Joined: 1 year ago
Posts: 16521
Topic starter  

TL;DR: Megalodon injected malicious GitHub Actions workflows into 5,561 public repositories in six hours, stealing cloud credentials, SSH keys, API tokens, and OIDC tokens by abusing weak branch protection and pipeline trust, according to StepSecurity. The campaign shows that CI pipelines are identity infrastructure, and standing workflow privilege is now a material secret-exfiltration risk.

Editorial analysis by NHI Mgmt Group, based on content published by StepSecurity: “Megalodon: Mass GitHub Actions Secret Exfiltration Across 5,500+ Public Repositories”.

By the numbers:

  • StepSecurity reports that 5,561 GitHub repositories were backdoored within a single six-hour window.
  • The campaign produced 5,718 malicious commits, according to StepSecurity.

Key questions

Q: What breaks when GitHub Actions workflow files can be changed directly?

A: The review gate breaks, and with it the trust boundary around CI execution.

Q: Why do CI workflows create such high secret-exfiltration risk?

A: They combine secret injection, token minting, and network access in the same execution context.

Q: What are the signs that a GitHub Actions workflow has been tampered with or is behaving maliciously?

A: Common warning signs include unexpected network destinations, new or unusual outbound traffic, changes in version tags without a corresponding code review, and workflow logs that suddenly contain sensitive values.

Practitioner guidance

  • Lock down workflow changes on protected branches Require mandatory review for changes under .github/workflows and block direct pushes to default branches so malicious workflow files cannot land without oversight.
  • Reduce secrets exposure inside CI jobs Minimise which credentials are injected into runners, split secrets by repository and job, and remove anything that is not strictly needed for the build step.
  • Constrain OIDC token minting Limit id-token: write to the few workflows that truly need cloud federation and tie those permissions to tightly scoped trust policies.

Bottom line: The campaign shows that a workflow file can become an active exfiltration path when CI runners inherit secrets and cloud federation rights.

Explore further

View Full Forum →  |  NHI Foundation Course →  |  Our Services →  |  Read the full analysis →



   
Quote
(@mr-nhi)
Member Moderator
Joined: 5 months ago
Posts: 17012
 

CI pipelines are now identity infrastructure: when workflows can read secrets and mint OIDC tokens, the pipeline itself becomes a non-human identity with privileged runtime authority. That changes the governance question from build security to credential governance, because the abuse path is access at execution time rather than compromise of application code. Practitioners should govern workflows as privileged identities with explicit issuance and change controls.

A few things that frame the scale:

  • 28.65 million new hardcoded secrets were detected in public GitHub commits in 2025 alone, a 34% year-over-year increase and the largest single-year jump ever recorded, according to the State of Secrets Sprawl 2026.

A question worth separating out:

Q: How should teams respond when workflow credentials are exposed in CI?

A: Contain the pipeline, revoke any secrets or tokens the job could access, rotate cloud and repository credentials, and review whether the same workflow path can still be changed without review. The response should focus on the trust path that allowed the job to run, not only on the specific malicious commit.

👉 Read our full editorial: Megalodon exposes how GitHub Actions become secret exfiltration paths



   
ReplyQuote
Share:

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.