Skip to content

pin qltysh/qlty-action to commit SHA (security: zizmor unpinned-uses)#3

Merged
vzakharchenko merged 3 commits into
mainfrom
chore/pin-third-party-action-sha
May 17, 2026
Merged

pin qltysh/qlty-action to commit SHA (security: zizmor unpinned-uses)#3
vzakharchenko merged 3 commits into
mainfrom
chore/pin-third-party-action-sha

Conversation

@vzakharchenko
Copy link
Copy Markdown
Member

Third-party GitHub Actions referenced by a mutable tag (@v2) can be silently hijacked if the maintainer or a compromised account force-pushes the tag. Pin to the exact commit SHA that v2 currently resolves to (v2.2.0, 2025-08-11) and keep the human-readable version as a trailing comment for review.

Official actions (actions/checkout, actions/setup-java, actions/cache) are intentionally left at @v4 — zizmor's allow-list and standard practice treat them as trusted.

vzakharchenko and others added 2 commits May 17, 2026 18:19
Third-party GitHub Actions referenced by a mutable tag (@v2) can be silently
hijacked if the maintainer or a compromised account force-pushes the tag.
Pin to the exact commit SHA that v2 currently resolves to (v2.2.0, 2025-08-11)
and keep the human-readable version as a trailing comment for review.

Official actions (actions/checkout, actions/setup-java, actions/cache) are
intentionally left at @v4 — zizmor's allow-list and standard practice treat
them as trusted.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… excessive-permissions)

Without an explicit permissions block, the job inherits the repository default,
which on this repo grants the broad read/write GITHUB_TOKEN scope. Switch to
default-deny at the workflow level (permissions: {}) and grant only what the
job actually uses:

- contents: read for actions/checkout
- pull-requests: write so the SonarCloud Maven plugin can decorate PRs and post
  inline comments via GITHUB_TOKEN
- checks: write so the same plugin can publish the "SonarCloud Code Analysis"
  check status

Qlty coverage upload uses its own QLTY_COVERAGE_TOKEN, so the GITHUB_TOKEN does
not need any additional scopes for that step.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@qltysh
Copy link
Copy Markdown

qltysh Bot commented May 17, 2026

Qlty


Coverage Impact

This PR will not change total coverage.

🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

actions/checkout defaults to writing GITHUB_TOKEN into .git/config so that
later git operations can authenticate as the workflow. None of the downstream
steps here use git push / tag / fetch beyond the initial checkout: mvn verify
runs Sonar via SONAR_TOKEN and GITHUB_TOKEN as env vars, and Qlty coverage
upload uses QLTY_COVERAGE_TOKEN.

Setting persist-credentials: false removes the credential from .git/config so
it cannot leak through anything that subsequently archives or uploads the
repo working tree.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

@vzakharchenko vzakharchenko merged commit 93c022f into main May 17, 2026
7 checks passed
@vzakharchenko vzakharchenko deleted the chore/pin-third-party-action-sha branch May 17, 2026 15:25
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