T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:50
- Finding
- Mutable GitHub Action Reference and Overly Broad Actions Allowlist<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:47-53` and `SKILL.md:77-79` **Vulnerability Type**: Supply-chain dependency risk **Risk Level**: Medium The documented workflow uses a mutable major-version tag for a GitHub Action: ```yaml steps: - name: Comment on issue uses: actions/github-script@v6 with: script: | const issue = context.payload.issue; const labels = issue.labels.map(l => l.name); ``` The documentation also directs users to enable an unrestricted Actions policy: ```markdown ### 2. Enable Actions - Repository Settings > Actions > Allow all actions ``` ### Technical Analysis The `actions/github-script@v6` dependency is referenced through a mutable version tag rather than an immutable, reviewed commit SHA. A version tag can resolve to different code after the workflow has been reviewed. Consequently, repository users cannot guarantee that future workflow runs execute the exact dependency revision originally audited. The recommendation to select “Allow all actions” unnecessarily expands the permitted dependency set. This permits workflows to invoke arbitrary third-party actions rather than limiting execution to GitHub-authored or explicitly approved actions. The example also does not declare explicit workflow-level or job-level `permissions`. Effective access therefore depends on repository and organization defaults. The workflow legitimately needs permission to create issue comments, but its token should not receive unrelated write capabilities. ### Attack Path 1. A repository administrator follows the documentation and permits all GitHub Actions. 2. The workflow or a subsequent workflow references an action through a mutable tag or introduces an unreviewed third-party action. 3. The referenced action is compromised, maliciously modified, or replaced with an unsafe revision. 4. GitHub downloads and executes that action on the hosted runner during a workflow run. 5. The action accesses the ...[truncated 1134 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `actions/github-script` to a reviewed full commit SHA instead of a mutable version tag: ```yaml permissions: contents: read issues: write jobs: reply: runs-on: ubuntu-latest steps: - name: Comment on issue uses: actions/github-script@<reviewed-full-commit-sha> with: script: | // Existing reviewed script ``` 2. Record the corresponding release version in a comment so maintainers can track updates while preserving immutable execution: ```yaml uses: actions/github-script@<reviewed-full-commit-sha> # v6.x.x ``` 3. Replace “Allow all actions” with an organization or repository policy that permits only GitHub-authored actions or an explicit allowlist of reviewed actions. 4. Declare minimal token permissions explicitly. This workflow requires `issues: write` to create comments and should normally use `contents: read`; unrelated write permissions should be disabled. 5. Review dependency updates before changing the pinned SHA. Use an automated dependency-update tool configured to propose pull requests for action updates, and require code review before merging them. 6. Avoid exposing repository or organization secrets to this job unless they are strictly required. Apply environment protections and branch protections to reduce the consequences of a compromised workflow dependency. ]]>
