Skip to content

Pin npm and actions in write-privileged workflows #127

Closed

Description

@TMHSDigital

Summary

Hardening for the workflows that hold write or publish permissions: they run code referenced by mutable tags or latest.

Checklist

  • publish.yml:40 runs npm install -g npm@latest right before npm publish --provenance in a job with id-token: write. Pin an exact npm version (or use a Node version whose bundled npm is >= 11.5.1).
  • Pin third-party and shared actions to full commit SHAs in write-privileged workflows: release-drafter/release-drafter@v7 (release-drafter.yml:18, runs on pull_request_target with contents: write), TMHSDigital/Developer-Tools-Directory/.github/actions/release-doc-sync@v1 (release.yml:124, followed by git add -A and a push to main). Dependabot's github-actions updater keeps SHA pins current.
  • release-drafter.yml: split autolabeling (pull_request_target, pull-requests: write only) from draft updating (push, contents: write), or drop pull_request_target if autolabeling is not used.
  • Add an explicit top-level permissions: contents: read to ci.yml and validate.yml.

Impact

An upstream tag or npm release that is hijacked would run with permission to push to main or publish @tmhs/homelab-mcp. Requires upstream compromise; this is defense in depth.

Getting started

  • Relevant files: .github/workflows/publish.yml, release.yml, release-drafter.yml, ci.yml, validate.yml

Filed by repo-audit/full-audit at a59395f. Severity: low. Effort: S. audit-key: ci|.github/workflows/publish.yml|npm-install-latest

Activity

  1. added
    good first issue
    severity: low
    on Nov 18, 2026
  2. TMHSDigital commented on Nov 18, 2026

    @TMHSDigital
    OwnerAuthor

    Fixed in e81ff65: publish.yml installs npm 11.21.3 instead of npm@latest; release-doc-sync is pinned to the v1.20.0 commit SHA; release-drafter is pinned to the v7.11.0 SHA and split into a push-only drafting job (contents: write) and a pull_request_target autolabel job using the v7 autolabeler sub-action (pull-requests: write only); ci.yml and validate.yml have top-level contents: read. Verified: on the push of e81ff65, Release Drafter (drafting job), Validate Plugin Structure and Release all succeeded. Dependabot's github-actions updater will keep the SHA pins current.

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

    cigood first issueseverity: low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions