T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:68
- Finding
- Mutable Third-Party GitHub Action Reference## Vulnerability Details **File Location**: `SKILL.md`, line 68 **Vulnerability Type**: Unpinned third-party CI dependency **Risk Level**: Medium **Vulnerable Code**: ```yaml - name: Security scan uses: aquasecurity/trivy-action@master ``` ### Technical Analysis The example workflow references `aquasecurity/trivy-action` through the mutable `master` branch rather than a reviewed, immutable commit SHA. Consequently, the code executed by future workflow runs can change without any corresponding change to this project. GitHub Actions run within the workflow job's security context. Depending on the generated workflow configuration, an action can interact with the checked-out repository, workspace files, artifacts, GitHub token, and credentials made available to the job. If the upstream repository or branch is compromised, force-updated, or modified maliciously, the workflow could execute attacker-controlled code. ### Attack Path 1. An attacker compromises the upstream action repository, a maintainer account, or the mutable `master` branch. 2. The attacker modifies the action code referenced by `aquasecurity/trivy-action@master`. 3. A repository uses the sample or generated workflow and triggers it through a push, pull request, or tag. 4. GitHub resolves `@master` to the attacker-controlled revision and executes it on the runner. 5. The malicious action accesses resources available to the job, potentially including source files, workflow tokens, registry credentials, or build artifacts. 6. The attacker may exfiltrate accessible credentials, modify artifacts, or tamper with a container image before publication. ### Impact Assessment Successful exploitation could permit arbitrary code execution within the CI runner and access to all resources granted to that workflow step. The precise scope depends on repository settings, event type, token permissions, and secret exposure. Potential consequences include source-code t ...[truncated 311 chars]
- Remediation
- ## Remediation Suggestions Pin the third-party action to a full, reviewed commit SHA: ```yaml - name: Security scan uses: aquasecurity/trivy-action@FULL_REVIEWED_COMMIT_SHA ``` Additionally: 1. Record the release tag corresponding to the pinned SHA in a comment for maintainability. 2. Review dependency updates before replacing the SHA. 3. Use an automated dependency-update tool that proposes reviewed SHA updates. 4. Pin every third-party GitHub Action generated by the Skill, not only Trivy. 5. Define explicit, least-privilege workflow `permissions`. 6. Expose registry credentials and other secrets only to steps that require them. 7. Separate scanning from image publication where practical, and require successful scans and protected-environment approval before publishing.
