Skip to content

Pin workflow actions and fix the codeql-action advisory exposure - #2553

Open
Totara-thib wants to merge 3 commits into
projectdiscovery:devfrom
Totara-thib:ci-hardening
Open

Pin workflow actions and fix the codeql-action advisory exposure#2553
Totara-thib wants to merge 3 commits into
projectdiscovery:devfrom
Totara-thib:ci-hardening

Conversation

@Totara-thib

Copy link
Copy Markdown

Proposed changes

Three commits, nothing about how the workflows behave changes except one security bump.

  • Move codeql-action off the advisory-affected v2 line. The v2 releases from 2.26.11 on sit in the range of GHSA-vqf5-2xx6-9wfm, CodeQL debug artifacts could contain the GitHub PAT, and no fixed v2 release exists, the fix shipped in 3.28.3. The v2 line is also deprecated. The three references move to the current release, pinned by SHA.
  • Pin every workflow action to a full commit SHA. The release path runs goreleaser with a token that can create releases, and the docker workflow logs into Docker Hub with the registry credentials. A version tag is a movable pointer, whoever controls an action repository can point it at different code after review, which is exactly what the tj-actions/changed-files incident (CVE-2025-30066) did to leak CI secrets. A SHA cannot be retargeted. Each pin keeps the version as a trailing comment for cross-checking against the action's releases page, versions stay exactly where they were, and dependabot keeps bumping SHA pins the same way it bumps tags today. This also settles the codeql refs resolving ambiguously as both a tag and a branch. The projectdiscovery/actions pins are included for consistency, happy to drop those hunks if you prefer trusting your own org namespace.
  • Declare token permissions. Only the release workflow writes through the GitHub token (goreleaser creating the release), it keeps contents: write. The test and docker workflows drop to read only, the Docker Hub push authenticates with its own registry credentials.

One heads-up: if the org restricts allowed actions with tag patterns like owner/action@v2, those patterns stop matching SHA refs and workflows fail at startup, the fix is owner/action@* in that setting. Nothing to do if no such restriction is configured.

Proof

Every SHA resolves to the exact tag named in its comment, verifiable on each action's releases page. All workflow files parse and the changes are ref-format only, except the codeql bump described above.

Checklist

  • Pull request is created against the dev branch
  • All checks passed (lint, unit/integration/regression tests etc.) with my changes
  • I have added tests that prove my fix is effective or that my feature works (not applicable, workflow-only change)
  • I have added necessary documentation (if appropriate) (not applicable)

Found and fixed by Plumber's analysis, reviewed and submitted by me.

The release path runs goreleaser with a token that can create
releases, and the docker push workflow logs into Docker Hub with the
registry credentials. Every action in those workflows was referenced
by a mutable tag, and whoever controls an action repository can point
a tag at different code after the fact. The tj-actions/changed-files
incident (CVE-2025-30066) rewrote tags exactly this way to leak CI
secrets. A commit SHA cannot be retargeted.

This also settles the codeql-action refs, where v2 resolves as both a
tag and a branch upstream and which revision runs is ambiguous.

The projectdiscovery/actions pins cover the org's own actions for
consistency, happy to drop those hunks if you prefer trusting the org
namespace. Each pin keeps the version as a trailing comment for
review, versions stay exactly where they were, and dependabot bumps
SHA pins the same way it bumps tags today.
Five workflows ran with the repository's default token grants. Only
the release workflow writes through the GitHub token, goreleaser
creates the release and uploads the binaries, so it keeps contents
write. The test and docker workflows drop to read only, the Docker
Hub push authenticates with its own registry credentials and never
needs the GitHub token.
The v2 releases from 2.26.11 on are in the range of GHSA-vqf5-2xx6-9wfm,
the CodeQL debug artifacts could contain the GitHub PAT, and no fixed
v2 release exists, the fix shipped in 3.28.3. The v2 line is also
deprecated. This moves the three codeql-action references to the
current release, pinned by SHA like the rest.
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (10)
  • .github/workflows/auto-merge.yaml is excluded by !**/*.yaml
  • .github/workflows/build-test.yml is excluded by !**/*.yml
  • .github/workflows/codeql-analysis.yml is excluded by !**/*.yml
  • .github/workflows/compatibility-checks.yaml is excluded by !**/*.yaml
  • .github/workflows/dep-auto-merge.yml is excluded by !**/*.yml
  • .github/workflows/dockerhub-push.yml is excluded by !**/*.yml
  • .github/workflows/functional-test.yml is excluded by !**/*.yml
  • .github/workflows/release-binary.yml is excluded by !**/*.yml
  • .github/workflows/release-test.yml is excluded by !**/*.yml
  • .github/workflows/stale.yaml is excluded by !**/*.yaml

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 29e323d7-da3d-4272-b04d-4433880bc8ce

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant