The workflow that ships your software holds the keys to your whole infrastructure. An automated campaign just proved how cheaply those keys get stolen at scale.
On May 18, an automated campaign codenamed Megalodon pushed 5,718 malicious commits to 5,561 GitHub repositories in roughly six hours. It did not exploit a clever zero-day. It did something simpler and more telling: it injected GitHub Actions workflows that read whatever secrets the CI runner could see, base64-encoded them, and shipped them to a server the attacker controlled. CI secrets, cloud credentials, SSH keys, OIDC tokens, the GITHUB_TOKEN itself, and anything it could grep out of the source.
It ran in two shapes: a mass variant that fires on every push and pull request, and a targeted variant that planted dormant workflows the attacker could trigger on demand later. The commits came from throwaway accounts wearing forged author names like build-bot and ci-bot, so the history looked like routine automation. It even crossed ecosystems, riding a compromised maintainer's normal npm publish downstream.
The honest caveat first, because it matters: Megalodon hit public repositories. If yours are private, you were almost certainly not in this campaign. That is not the point. The point is where the soft tissue is, and it is the same whether your repo is public or private: your CI/CD pipeline is now a first-class attack surface, and the deploy workflow that ships your software is holding the keys to your entire infrastructure.
Three structural facts make the pipeline attractive, and they are true of almost every team.
The whole job of a deploy workflow is to authenticate to your cloud, push to your buckets, invalidate your CDN, write to your database. To do that, it holds powerful secrets. Whatever the runner can read, a malicious step in that runner can read too.
Every third-party action you reference, every dependency you install, every fork's pull request runs code inside your pipeline. The trust boundary is enormous and mostly invisible.
This is the quiet killer. If your workflow authenticates with a long-lived access key, an attacker who exfiltrates it has a credential that works until a human notices and rotates it, which is frequently never. The breach outlives the build. Megalodon did not need to be sophisticated, because most pipelines are soft in exactly these three places.
There is no product to buy here. There are a handful of cheap, boring practices that, taken together, defang the whole category. This is the posture we hold our own work to and the first thing we look at in a client's pipeline.
Move CI authentication to OIDC. Instead of storing a static cloud access key, the workflow requests a short-lived token at run time, scoped to that repository and job, that expires when the job ends. The difference under attack is total: a stolen static key works until someone rotates it; a stolen OIDC token is dead weight the moment the job finishes. This turns "attacker now has our cloud" into "attacker has a token that already expired." It is the single most important change on this list.
When you write uses: some/action@v3, you are trusting whoever controls that tag to never repoint it at malicious code, forever. Tags are mutable; a hijacked account can repoint v3 at a payload that flows straight into your pipeline. Pinning to a full commit hash freezes exactly the code you reviewed. Pair it with automated updates so security patches still reach you on your terms.
A workflow with no explicit permissions block inherits the repository default, which is often read and write across the board. Set the default to read-only and grant write only to the job that genuinely needs it. If a step is ever compromised, this is the difference between "it could read the repo" and "it could rewrite your releases."
Megalodon's whole technique was pushing commits directly. Requiring a pull request and a review before anything merges to your deploy branch means a malicious commit has to get past a human, not just past an automated push. Combine it with secret scanning and push protection so a leaked credential is caught at the door.
Your CI pipeline holds the keys to your infrastructure, an automated campaign just proved how cheaply those keys get stolen at scale, and the fix is not a product but four boring practices: short-lived OIDC credentials, hash-pinned actions, least-privilege build tokens, and a protected branch.
If you ship through CI/CD and have not looked hard at what your deploy workflow can actually touch, that review is a focused, high-value piece of work, and it is the kind of thing we do. We will look at how your pipeline authenticates, what it can reach, which third-party code runs inside it, and what an attacker would get if they landed a single malicious step. Then we will tell you the handful of changes that matter most for your specific setup, in priority order.
We do not take every engagement, and we will tell you on the call whether we are the right partner.