T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:153
- Finding
- Unpinned Third-Party Dependencies Create Supply-Chain Risk## Vulnerability Details **File Location**: `SKILL.md`, lines 153–154 and 181–183 **Vulnerability Type**: Unpinned executable dependencies **Risk Level**: Medium ### Vulnerable Code ```bash npm install --save-dev @openzeppelin/hardhat-upgrades npm install --save-dev @nomicfoundation/hardhat-ethers ethers # peer dependencies ``` ```bash forge install foundry-rs/forge-std forge install OpenZeppelin/openzeppelin-foundry-upgrades forge install OpenZeppelin/openzeppelin-contracts-upgradeable ``` Related configuration and behavior at lines 190 and 196: ```toml ffi = true ``` > Node.js is required — the library shells out to the OpenZeppelin Upgrades CLI for validation. ### Technical Analysis The installation commands do not specify exact npm versions, reviewed Git tags, or immutable commit hashes. Consequently, executing the instructions at different times can retrieve different code than the content originally reviewed. npm dependencies can execute lifecycle scripts during installation. Foundry dependencies contribute code to compilation and deployment workflows. The documented use of Foundry FFI and an external Node.js validation CLI expands the execution boundary: a compromised dependency may influence subprocess execution, generated artifacts, validation results, or deployment operations. This finding does not establish that the named upstream projects are malicious. The risk arises from mutable dependency resolution and the absence of explicit integrity controls. ### Attack Path 1. An attacker compromises an upstream package, repository, maintainer account, or package publication process. 2. The attacker publishes malicious code under a version or repository revision selected by the unpinned installation command. 3. A user or agent follows the Skill instructions and installs the dependency. 4. Malicious logic executes through an npm lifecycle script, the build process, imported Foundry code, or th ...[truncated 983 chars]
- Remediation
- ## Remediation Suggestions 1. Pin every npm dependency to an audited exact version rather than a floating range, and commit the generated lockfile. 2. Use deterministic installation commands such as `npm ci` in CI and production-sensitive workflows. 3. Pin every Foundry dependency to a reviewed release tag or, preferably, an immutable commit hash. 4. Commit and review Foundry submodule references so dependency revisions cannot change silently. 5. Verify package integrity and use trusted registries and repository sources. 6. Review npm lifecycle scripts before installation; disable scripts where they are unnecessary. 7. Run dependency installation, compilation, and validation in an isolated environment without wallet keys or production credentials. 8. Enable FFI only for workflows that require it, restrict the commands and environment available to subprocesses, and disable it for ordinary builds. 9. Add automated dependency review, vulnerability scanning, and controlled update procedures so version changes require explicit security approval.
