A security scanner in CI is trusted code with an unusual amount of reach. It runs on every push, it reads the whole repository, and it often sits in the same job as the tokens that publish your releases. In March 2026 that combination was used exactly as you would fear: a scanner's GitHub Action was retagged to credential-stealing code, and the secrets it collected were used to publish a malicious release of a widely used Python package.
The lesson is not "stop scanning". It is that a scan tool is a dependency like any other, and it needs the same pinning, isolation and least privilege you would give a build tool you did not write.
What happened
Three incidents show the pattern.
A retagged scanner action (March 2026). According to GitHub advisory GHSA-69fq-xp46-6x23 (CVE-2026-33634, rated Critical), on 19 March 2026 an attacker with stolen credentials force-pushed 76 of 77 version tags of a popular open-source vulnerability scanner's GitHub Action, and replaced every tag of its companion setup action. The injected code ran before the real scan, so jobs still looked normal. It read the runner's Runner.Worker process memory to pull out secrets, swept the file system for SSH keys, cloud credentials, Kubernetes tokens and .env files, encrypted the lot and sent it to attacker infrastructure. The advisory traces the root cause to a credential rotation after an earlier incident that "was not atomic", which left the attacker a window to collect the new secrets.
The downstream release (March 2026). The LiteLLM project states that it believes its compromise originated from that scanner, which ran as a dependency of its CI/CD security scanning workflow. On 24 March 2026 malicious versions 1.82.7 and 1.82.8 were uploaded straight to PyPI, bypassing the project's release workflow, and harvested environment variables, SSH keys, cloud credentials and database passwords from whoever installed them. GitHub tracks it as GHSA-92x9-889m-jgmw. One compromised scan step became a compromised package for everyone downstream.
The earlier warning (March 2025). CVE-2025-30066 hit tj-actions/changed-files, a utility action, not a scanner. Attackers moved multiple version tags to a malicious commit that dumped runner memory into the build log, where any public repository's logs exposed the secrets. The advisory puts the reach at over 23,000 repositories.
The common mechanism: a mutable reference (a tag) pointed at code that ran with secrets in scope.
Why scan steps are a good target
| Property of a scan step | Why an attacker likes it |
|---|---|
| Runs on every push and pull request | Many executions, many repositories |
| Reads the whole checkout | Sees .env files, config, lockfiles |
| Often added as "just one more step" in the release job | Shares the job with publish tokens and id-token: write |
Often referenced by tag (@v1, @master) |
Whoever moves the tag changes the code |
| Often downloads a binary or rules at run time | A second moving reference inside the first |
| Output is expected to be noisy | Odd log lines and network calls go unnoticed |
Pin every moving reference
Actions by full commit SHA. GitHub's secure use reference says to pin actions to a commit SHA because it "helps mitigate the risk of a bad actor adding a backdoor to the action's repository". A tag can be force-pushed; a 40-character SHA cannot be changed to point at other code. Keep the version in a comment so humans and update bots can read it:
- uses: some-org/scan-action@<full 40-character commit SHA> # v2.3.1Organisation admins can now enforce this: GitHub's allowed actions policy supports SHA pinning enforcement and a blocklist, so an unpinned action fails instead of running.
Images by digest. The 2026 advisory notes that digest-pinned images were not affected. Use image@sha256:..., not :latest or a version tag that can be republished.
Binaries by version and checksum. A pinned action that runs curl .../install.sh | sh with no version, or fetches "latest" at run time, is still unpinned. Install a named version and check its hash or signature before running it.
SHA pinning is not the whole answer. A pinned commit can contain a vulnerability or fetch something unpinned itself, and pins need deliberate updates. Treat a pin bump like a dependency upgrade: read the diff.
Give the scan job nothing worth stealing
Pinning stops someone else changing the code you run. Least privilege limits the damage when the code you chose turns out to be bad.
- Default the token to read-only. Put
permissions: {}orcontents: readat the top of the workflow and grant write scopes per job. A scan job needscontents: read, andsecurity-events: writeif it uploads SARIF. - Split scan and release into separate jobs. The scan job should hold no publish token, no cloud deploy key and no
id-token: write. Release secrets belong to a release job that runs pinned, minimal steps behind an environment approval. - Use short-lived publish credentials. Trusted publishing on PyPI and npm mints a token per run through OIDC, so there is no long-lived token sitting in repository secrets for a scanner to read.
- Keep scans off
pull_request_target. GitHub says workflows on that trigger "must not explicitly check out untrusted code". A scan of a fork's code belongs onpull_request, with no secrets. - Restrict egress where you can. A scanner that needs no network can run on a runner with outbound traffic blocked, which turns exfiltration into a failed connection.
A minimal shape:
permissions: {}
jobs:
scan:
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
steps:
- uses: actions/checkout@<commit SHA> # v5
- run: ./tools/scanner scan . > results.sarif # a pinned, checksummed binary
# no publish token, no id-token, no cloud credentials in this job
release:
needs: scan
environment: release # approval gate
permissions:
contents: read
id-token: write # trusted publishing, short-lived
steps:
- uses: actions/checkout@<commit SHA>
# build and publish only: no third-party scan steps hereIf a scan action you use is compromised
Assume every secret the job could read is exposed, including the GITHUB_TOKEN scopes and anything in runner memory. Rotate them all at once rather than one by one: the 2026 advisory shows how a staggered rotation hands an attacker the new values. Then search workflow logs for the exposure window, check for unexpected repositories or releases under your organisation, and review what was published while the secrets were exposed. Our 60-minute rotation runbook covers the order of operations.
Where Vulkro fits
Vulkro Core reads your workflow files as part of a normal scan and flags the shapes above:
| Rule | What it flags |
|---|---|
supply-ci-unpinned-action |
A third-party action referenced by tag or branch, not a commit SHA |
supply-ci-secret-to-unpinned-action |
A secret passed to an action on a mutable ref |
supply-ci-unpinned-tool-in-release |
A job holding publish secrets or id-token: write that runs an unpinned action, image or tool |
supply-ci-permissions |
permissions: write-all, or contents: write on a pull_request_target workflow |
supply-ci-long-lived-publish-token |
A publish step using a stored registry token instead of trusted publishing |
supply-ci-publish-no-environment |
A publishing job with no environment approval gate |
vulkro scan . --format sarif > vulkro.sarifVulkro is also a tool in your pipeline, so the same rules apply to it. The installer takes a pinned version (VULKRO_VERSION), checks the SHA-256 and the signed checksum manifest before installing, and the scan itself needs no network: run it with --offline (or VULKRO_OFFLINE=1) on a runner with egress blocked, in a job that holds no release secrets.
FAQ
Does pinning an action to a commit SHA make it safe?
It makes it fixed, not safe. A SHA cannot be moved to new code, which defeats retagging attacks like the 2025 and 2026 incidents. The pinned code can still have bugs or download unpinned tools at run time, so review what it fetches and update pins deliberately.
Should the security scan run in the release job?
No. Run scanners in a separate job with a read-only token and no publish or cloud credentials, and make the release job depend on it. The release job should contain only the pinned steps needed to build and publish.
What should I rotate if a CI action I used was compromised?
Every secret available to the affected jobs: repository and organisation secrets, cloud keys, registry tokens and anything written to the runner. Rotate them together, then check logs and published artifacts from the exposure window.
See the release gating use case and the GitHub Actions setup guide, or start a 14-day trial. Related: GitHub Actions security: six workflow mistakes and what the Shai-Hulud worm changed for CI.