T08 · Insecure Dependencies
Warning
- Location
- README.md:15
- Finding
- Unpinned Third-Party Packages and Mutable Repository Sources<![CDATA[ ## Vulnerability Details **File Locations**: - `README.md:15-25` - `references/api-reference.md:188` - `references/api-reference.md:225` - `references/api-reference.md:335` **Vulnerability Type**: Unpinned third-party dependency execution **Risk Level**: Medium ### Vulnerable Code `README.md:15-25`: ```markdown ## Install ```bash npx skills add anivar/zod-testing -g ``` Or with full URL: ```bash npx skills add https://github.com/anivar/zod-testing ``` ``` `references/api-reference.md:188`: ```bash npm install -D zod-schema-faker ``` `references/api-reference.md:225`: ```bash npm install -D @anatine/zod-mock @faker-js/faker ``` `references/api-reference.md:335`: ```bash npm install -D fast-check ``` ### Technical Analysis The documented installation commands resolve mutable third-party package or repository state without exact versions, commit hashes, or integrity constraints. The `npx skills add` command may download and execute the currently resolved version of the `skills` package. The GitHub installation form references a mutable repository rather than an audited commit. Similarly, the `npm install` examples install versions selected by npm at execution time. Depending on package configuration, installation can execute lifecycle scripts such as `preinstall`, `install`, or `postinstall`. The global `-g` option increases the scope and persistence of the installed Skill relative to a project-local installation. Although the audited project does not itself contain a malicious payload, these instructions create a supply-chain execution path whose effective code can change after this audit. ### Attack Path 1. An attacker compromises a referenced npm package, its maintainer account, the package registry, or the referenced GitHub repository. 2. The attacker publishes a malicious package version or modifies the repository's mutable default branch. 3. A user or AI agent follows one of the documented unpinned installation commands. 4. npm or ...[truncated 1108 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin command-line tools and npm dependencies to exact reviewed versions: ```bash npx skills@REVIEWED_VERSION add anivar/zod-testing -g npm install -D zod-schema-faker@REVIEWED_VERSION npm install -D @anatine/zod-mock@REVIEWED_VERSION @faker-js/faker@REVIEWED_VERSION npm install -D fast-check@REVIEWED_VERSION ``` 2. Pin GitHub installations to a reviewed immutable commit SHA rather than a branch or default repository revision. 3. Prefer project-local installation over global installation unless global scope is necessary. 4. Commit and review the generated lockfile. Use `npm ci` in automated environments so dependency resolution follows the reviewed lockfile. 5. Verify package provenance, integrity metadata, publisher identity, and release history before installation. 6. Run dependency installation in a sandbox or least-privileged environment without unnecessary credentials or sensitive environment variables. 7. Where operationally possible, disable dependency lifecycle scripts during initial inspection: ```bash npm install --ignore-scripts ``` Enable required scripts only after reviewing their contents. 8. Add automated dependency auditing and controlled update workflows so newly published versions are reviewed before adoption. ]]>
