T08 · Insecure Dependencies
Warning
- Location
- .github/workflows/validate.yml:18
- Finding
- Unpinned Remote Dependency Is Installed and Executed in CI## Vulnerability Details **File Location**: `.github/workflows/validate.yml`, lines 18–22 **Vulnerability Type**: Mutable third-party dependency execution **Risk Level**: Medium ### Vulnerable Code ```yaml - name: Validate Agent Skills format run: | git clone --depth 1 https://github.com/agentskills/agentskills.git /tmp/agentskills python3 -m pip install /tmp/agentskills/skills-ref skills-ref validate "$GITHUB_WORKSPACE" ``` ### Technical Analysis The workflow clones the current default branch of an external Git repository and installs its `skills-ref` package without pinning a reviewed commit. The effective dependency can therefore change independently of this repository. Python package installation can execute code through its build backend and installation hooks. A compromise of the upstream repository, its maintainers, or its default branch could introduce code that executes automatically on the GitHub Actions runner during `pip install`. The workflow limits `GITHUB_TOKEN` to read-only repository-content access, which reduces potential impact, but does not prevent malicious dependency code from reading the checked-out repository, accessing runner environment data, using outbound network connectivity, altering generated validation results, or interfering with later workflow steps. ### Attack Path 1. An attacker compromises the upstream `agentskills/agentskills` repository, a maintainer account, or another mechanism controlling its default branch. 2. The attacker modifies the `skills-ref` package or its build configuration to execute malicious code during installation. 3. A push to `main` or a pull request triggers the validation workflow. 4. The workflow clones the attacker-controlled current revision because no commit SHA is specified. 5. `python3 -m pip install /tmp/agentskills/skills-ref` invokes the malicious build or installation logic. 6. The payload executes with the privileges of the GitHub-hosted runner and the workflow's avail ...[truncated 609 chars]
- Remediation
- ## Remediation Suggestions - Pin the external repository to a reviewed full commit SHA rather than cloning its mutable default branch. - Verify the checked-out commit before installation. - Prefer a trusted, versioned package artifact with cryptographic hashes and install it using a hash-locked requirements file and `pip --require-hashes`. - Keep the workflow token at its existing least-privilege level. - Restrict outbound network access during validation where the CI platform permits it. - Pin third-party GitHub Actions, including `actions/checkout`, to full commit SHAs for additional supply-chain hardening. - Use dependency update automation to propose and review pin changes explicitly.
