T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:1019
- Finding
- Mutable Third-Party CI Action Executes with Repository Runner Access## Vulnerability Details **File Location**: `SKILL.md`, lines 1019-1023 **Vulnerability Type**: Mutable third-party CI dependency **Risk Level**: Medium ### Vulnerable Code ```yaml - name: Scan for vulnerabilities uses: aquasecurity/trivy-action@master with: image-ref: ghcr.io/${{ github.repository }}:${{ github.sha }} exit-code: 1 severity: CRITICAL,HIGH ``` ### Technical Analysis The generated GitHub Actions workflow references `aquasecurity/trivy-action` through the mutable `master` branch rather than an immutable, reviewed commit SHA. The code associated with this reference can change after the Skill and generated workflow have been reviewed. GitHub Actions execute third-party action code on the workflow runner. Depending on workflow permissions and surrounding steps, that code may be able to read checked-out repository content, inspect the runner environment, modify build artifacts, and use credentials exposed to the job. The surrounding workflow also authenticates to GitHub Container Registry using `secrets.GITHUB_TOKEN`, increasing the potential consequences if the action or its upstream account is compromised. This is a supply-chain weakness; the audit did not identify evidence that the current upstream action is malicious. ### Attack Path 1. An attacker compromises the upstream repository, maintainer account, or mutable `master` branch. 2. The attacker adds malicious commands to the action implementation. 3. A repository uses the workflow generated from this Skill and triggers it through a push to `main`. 4. GitHub resolves `aquasecurity/trivy-action@master` to the attacker-modified revision. 5. The modified action executes on the repository's CI runner. 6. Subject to the job's configured permissions, the action can access repository files and runner data, tamper with artifacts, or abuse available GitHub token permissions. ### Impact Assessment The immediate execution scope is the GitHub Actions runner and the affected workflo ...[truncated 473 chars]
- Remediation
- ## Remediation Suggestions 1. Pin the action to a reviewed full commit SHA rather than a branch or mutable tag: ```yaml - name: Scan for vulnerabilities uses: aquasecurity/trivy-action@FULL_REVIEWED_COMMIT_SHA with: image-ref: ghcr.io/${{ github.repository }}:${{ github.sha }} exit-code: 1 severity: CRITICAL,HIGH ``` 2. Record the corresponding release version in a comment so automated dependency tools can identify and update it safely. 3. Define explicit least-privilege workflow permissions. For example: ```yaml permissions: contents: read ``` Grant `packages: write` only to the specific job or step that must publish an image. 4. Separate image publication and vulnerability scanning into jobs with distinct permissions where practical. The scanning job should not receive package-write credentials. 5. Review dependency updates before changing the pinned SHA. Use Dependabot or Renovate to propose controlled updates without restoring mutable references.
