Skip to content

Pin workflow actions to commit SHAs and narrow release write scope #41

Closed

Description

@TMHSDigital

Summary

release.yml grants contents: write at workflow level and runs a third-party action and an org composite action pinned to mutable tags, then commits whatever is in the working tree with git add -A. Pinning actions to commit SHAs and narrowing the write scope is standard workflow hardening.

Where

  • .github/workflows/release.yml:7-8 (permissions: contents: write, workflow level)
  • .github/workflows/release.yml:120 (TMHSDigital/Developer-Tools-Directory/.github/actions/release-doc-sync@v1)
  • .github/workflows/release.yml:174-176 (git add -A, git commit, git push)
  • .github/workflows/release.yml:186 (softprops/action-gh-release@v3)
  • .github/workflows/drift-check.yml:18 (.../[email protected])
  • .github/workflows/update-natives.yml:8-9, .github/workflows/update-docs-index.yml:8-9 (contents: write)

Details

  • release-doc-sync@v1 is a floating major tag and action-gh-release@v3 is a tag ref; both run with a write token on every push to main.
  • Right after release-doc-sync, the workflow runs git add -A and pushes to main, so any file the action writes is committed without review.
  • Every other uses: across the 7 workflows (actions/checkout@v7, actions/setup-python@v6, actions/stale@v10, actions/deploy-pages@v5, ...) is tag-pinned, not SHA-pinned.
  • The two Developer-Tools-Directory actions follow different policies: drift-check is pinned to v1.9 while release-doc-sync floats on v1.

Impact

If an upstream tag is moved, the new code runs with write access to this repository on every push to main and can publish releases of a plugin users run as an MCP server. SHA pinning removes that dependency on tag integrity.

Suggested fix

  • Pin every uses: to a full commit SHA with a version comment (for example softprops/action-gh-release@<sha> # v3.x.y), including the first-party composite actions. Dependabot's github-actions ecosystem (already configured) keeps SHA pins updated.
  • Move permissions: contents: write from workflow level to the job that needs it.
  • Replace git add -A with an explicit list (.cursor-plugin/plugin.json README.md CLAUDE.md CHANGELOG.md).
  • Pick one policy for the Developer-Tools-Directory actions (both SHA-pinned, or both on the same floating major).

Acceptance criteria

  • No uses: in .github/workflows/ references a tag or branch without a SHA.
  • contents: write is declared only on jobs that push or release.
  • The release commit step stages an explicit file list.

Getting started

  • Relevant files: .github/workflows/*.yml, .github/dependabot.yml
  • How to run checks: there is no test suite yet; run the MCP server with cd mcp-server && pip install -r requirements.txt && python server.py, and CI checks live in .github/workflows/validate.yml
  • Related docs: GitHub docs on security hardening for GitHub Actions (using third-party actions)

Filed by repo-audit/full-audit at 701824d. Severity: medium. Effort: S. audit-key: ci|.github/workflows/release.yml|uses-pinning

Activity

  1. added
    ci
    on Nov 21, 2026
  2. TMHSDigital commented on Nov 21, 2026

    @TMHSDigital
    OwnerAuthor

    Fixed in 440a31d.

    Third-party and GitHub actions are SHA-pinned with version comments; contents: write is now declared only on the release, update-natives and update-docs-index jobs; the release commit stages an explicit file list. The two Developer-Tools-Directory actions intentionally stay on floating tags, because the meta-repo's ci-cd and release-doc-sync standards require @vMAJOR.MINOR / @vmajor for first-party callers; drift-check moved from the stale @v1.9 to the current @v1.20.

    Verified: All workflow files parse; git grep uses: shows only SHA pins plus the two documented first-party tags.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    ciseverity: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions