Is GitHub Actions Putting Your Software at Risk?

The recent Trivy GitHub Actions security incident got me thinking more seriously about the security model around CI systems. Most teams spend a lot of time thinking about dependency security, but I increasingly think GitHub Actions workflows deserve to be viewed through the exact same lens. In some cases, they may actually represent a larger supply chain risk than ordinary code dependencies.

A compromised npm package usually impacts an application runtime. A compromised GitHub Action can have much larger blast radius. CI builds are a nexus of many parts of the software lifecycle: source, secrets, cloud platform auth, and third-party code. It’s easy to look at GitHub Actions workflow definitions as harmless yaml configuration, but the underlying systems are a privileged execution environment at the heart of the software supply chain.

The Problem With Mutable Trust

A very common workflow pattern looks something like this:

- uses: actions/checkout@v4
- uses: third-party/[email protected]

At a glance, these references feel stable and versioned similarly to package dependencies. But GitHub Action tags are primarily a user interface and compatibility mechanism, not an immutability guarantee. Tags like @v4 are ergonomic, human-readable, and communicate expected compatibility, but they are still mutable git references underneath.

If an attacker gains control of an action repository, they can potentially move those tags to malicious commits. Suddenly thousands of workflows can begin executing attacker-controlled code without any workflow file changing at all. The Trivy incident is not the first such security incident, but it did shine a bright light on this issue.

Why Actions Are So Sensitive

GitHub Actions are uniquely risky because of where they execute and what they can access. CI runners often contain cloud credentials, package publishing tokens, SSH keys, Kubernetes auth, deployment credentials, repository write permissions, signing keys, and internal environment configuration. Once a malicious action executes inside that environment, it inherits whatever permissions and secrets are available to the workflow.

This creates a very different blast radius than most ordinary dependency compromises. A malicious library might compromise one application build. A malicious GitHub Action can become a pivot point into cloud infrastructure, release systems, registries, and additional repositories.

The attack surface also extends beyond third-party actions themselves. Workflow YAML and shell steps can introduce injection vulnerabilities if they interpolate untrusted values like branch names or PR titles. Logs and artifacts can also become exfiltration channels for secrets and credentials.

Pinning To SHAs

GitHub’s own security guidance recommends pinning third-party actions to full commit SHAs instead of tags. Their documentation states that “Pinning an action to a full-length commit SHA is the most reliable way to use an immutable version of an action.

The safer pattern looks something like this:

- uses: third-party/custom-action@692973e3d937129bcbf40652eb9f2f61becf3332 # v3.2.0

The inline comment is a nice compromise. You still preserve the human-readable version context while anchoring execution to an immutable commit.

There is definitely some ergonomics tradeoff here compared to tags. But I think that tradeoff feels reasonable once workflows are viewed as privileged software dependencies instead of simple CI configuration.

Final Thoughts

I do not think GitHub Actions is fundamentally broken. I still think it is an extremely capable platform and hard to avoid in modern engineering organizations. But I also think many teams underestimate how much privilege is concentrated inside CI systems.

Treating workflows with the same scrutiny applied to application dependencies leads pretty naturally to a handful of defensive practices: pin third-party actions to SHAs, minimize `GITHUB_TOKEN` permissions, isolate sensitive environments, reduce secret exposure between jobs, and review workflow changes like application code.

Build automation often feels operational and harmless, but modern CI systems sit directly in the center of the software supply chain.

Conversation

Join the conversation

Your email address will not be published. Required fields are marked *