T08 · Insecure Dependencies
Error
- Location
- references/formats.md:69
- Finding
- Unverified and Unpinned Third-Party Dependency Installation## Vulnerability Details **File Location**: `references/formats.md:28-30, 43, 69-74, 89-91, 130-132, 156` **Vulnerability Type**: Unsafe installation of mutable third-party dependencies **Risk Level**: High ### Vulnerable Code At `references/formats.md:28-30`: ```bash sudo dnf install jq # Fedora sudo apt install jq # Debian/Ubuntu brew install jq # macOS ``` At `references/formats.md:43`: ```bash npm install -g ajv-cli ``` At `references/formats.md:69-74`: ```bash wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O yq chmod +x yq sudo mv yq /usr/local/bin/ # Or via pip pip install yq ``` At `references/formats.md:89-91`: ```bash # Install yamllint pip install yamllint ``` At `references/formats.md:130-132`: ```bash pip install toml # or pip install tomli # Python 3.11+ built-in ``` At `references/formats.md:156`: ```bash pip install yq ``` ### Technical Analysis The Skill recommends installing third-party executables and packages without pinning exact versions or verifying artifact integrity. The most serious instance downloads the `yq` executable from a mutable `latest` release URL, marks it executable, and places it in `/usr/local/bin` using `sudo`. No cryptographic checksum, signature, immutable version, or provenance verification is performed. Consequently, the downloaded bytes can change after the Skill has been reviewed. The npm and pip instructions also install mutable package versions from external registries. They do not use lockfiles, hashes, exact versions, isolated environments, or package provenance checks. Global npm installation further increases the affected scope. This creates a supply-chain trust boundary in which compromise of an upstream project, release account, package registry, dependency, distribution channel, or package name can result in attacker-controlled code being installed and executed locally. ### Attack Path 1. An attacker compromises a referenced upstream release, ...[truncated 2055 chars]
- Remediation
- ## Remediation Suggestions 1. **Pin immutable versions** - Replace `latest` URLs with exact release versions. - Pin exact pip and npm package versions. - Maintain dependency lockfiles where applicable. 2. **Verify downloaded artifacts** - Download the checksum or signature through a trusted channel. - Verify SHA-256 or stronger digests before granting execute permission. - Prefer signed releases and validate signatures against a pinned maintainer key. 3. **Avoid privileged global installation** - Install command-line tools into a user-controlled directory or an isolated project environment. - Avoid `sudo` unless system-wide installation is explicitly required and approved. - Do not overwrite an existing executable without confirming its origin and obtaining user consent. 4. **Use isolated dependency environments** - Install Python dependencies in a virtual environment. - Use project-local npm dependencies instead of `npm install -g`. - Use hash-locked dependency installation, such as pip requirements with `--require-hashes`. 5. **Validate package provenance** - Confirm the expected publisher, repository, package name, and release metadata. - Prefer trusted operating-system repositories where their signing and update model meets the deployment requirements. - Review transitive dependencies and use automated dependency vulnerability scanning. 6. **Harden the direct-download workflow** - Download into a securely created temporary directory. - Fail closed if integrity verification does not succeed. - Confirm the target architecture and operating system. - Inspect whether `/usr/local/bin/yq` already exists before installation. - Document a safe rollback or removal procedure.
