T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:626
- Finding
- Unpinned PyYAML Dependency in CI Workflow Example## Vulnerability Details **File Location**: `SKILL.md`, line 626 **Vulnerability Type**: Unpinned third-party dependency installation **Risk Level**: Medium ### Vulnerable Code ```yaml - name: K8s Security Audit run: | pip install pyyaml -q python3 .claude/skills/phy-k8s-security-audit/audit_k8s.py --ci ./k8s/ ``` ### Technical Analysis The documented GitHub Actions workflow installs PyYAML without a fixed version or verified package hash. Each CI execution therefore resolves the dependency against the package index at runtime and may install a different release. Although no malicious dependency is currently demonstrated, this practice creates supply-chain and reproducibility risks. A compromised package publisher account, package-index compromise, or unexpectedly incompatible future release could cause attacker-controlled or unreviewed code to execute when Python imports `yaml`. ### Attack Path 1. A user copies the documented workflow into a repository. 2. The CI runner executes `pip install pyyaml -q` without version or hash constraints. 3. The package index resolves the installation to the latest available PyYAML distribution. 4. If that distribution or its publishing channel has been compromised, malicious installation or import-time code is placed on the runner. 5. The audit script imports `yaml`, causing the installed package code to execute within the CI job. 6. That code can access resources available to the job, subject to the workflow's token permissions, secret exposure rules, network access, and runner isolation. ### Impact Assessment Successful exploitation could execute arbitrary code with the privileges of the CI runner. Depending on workflow configuration, the affected scope may include checked-out source code, generated build artifacts, environment variables, available CI secrets, network-accessible services, and permissions granted to the workflow token. On a persistent or self-h ...[truncated 234 chars]
- Remediation
- ## Remediation Suggestions - Pin PyYAML to a specific, reviewed version rather than resolving the latest release dynamically. - Store dependencies in a lock or requirements file with cryptographic hashes. - Install dependencies using hash verification, for example: ```bash python3 -m pip install --require-hashes -r requirements.txt ``` - Generate `requirements.txt` so that it contains an exact PyYAML version and hashes for all accepted distributions. - Review dependency updates through a controlled pull-request process and rerun security testing before changing the pin. - Apply least-privilege permissions to the GitHub Actions token using an explicit `permissions` block. - Avoid exposing unnecessary secrets to this job, and prefer ephemeral, isolated runners.
