T08 · Insecure Dependencies
Error
- Location
- references/install-and-invoke.md:13
- Finding
- Unpinned npm Package Installation and Immediate Execution<![CDATA[ ## Vulnerability Details **File Location**: `references/install-and-invoke.md:13-26` **Additional Locations**: `SKILL.md:20-23`, `references/install-and-invoke.md:44-51`, `references/troubleshooting.md:9-13` **Vulnerability Type**: Unpinned third-party dependency installation and execution **Risk Level**: High ### Vulnerable Code ```markdown ## Install The npm Package Prefer a global install when the user wants the `obclip` command on `PATH`: ```powershell npm install -g @harris7/obclip obclip --help ``` Use `npx` when the user does not want a global install: ```powershell npx @harris7/obclip --help ``` ``` ### Technical Analysis The Skill instructs the agent to install or execute `@harris7/obclip` without specifying an exact version, lockfile, package integrity hash, or other immutable verification mechanism. `npm install -g @harris7/obclip` resolves the package version from the npm registry at installation time, modifies the user's global npm environment, and may execute npm lifecycle scripts. Similarly, `npx @harris7/obclip --help` can retrieve and immediately run the currently resolved package release. Consequently, the effective code executed by the Skill can change after this Skill has been audited. Exploitation would require compromise or malicious control of the package, its publisher account, the registry resolution path, or a transitive dependency. The audited files do not establish that the current package is malicious; the vulnerability is the absence of supply-chain pinning and verification before execution. ### Attack Path 1. An attacker compromises the npm publisher account, package distribution channel, or a dependency used by `@harris7/obclip`. 2. The attacker publishes a malicious version that satisfies the unpinned package reference. 3. A user invokes the Skill on a system where `obclip` is unavailable. 4. Following the Skill instructions, the agent runs either: - `npm install -g @harris7/obclip`, or - `npx @harri ...[truncated 1170 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin the dependency to an exact reviewed version, for example: ```powershell npm install --global --ignore-scripts @harris7/obclip@X.Y.Z ``` Replace `X.Y.Z` with a version that has undergone security review. 2. Prefer a project-local installation governed by a committed lockfile instead of modifying the global npm environment: ```powershell npm install --save-exact @harris7/obclip@X.Y.Z npm ci ``` 3. Verify registry integrity metadata and package provenance before execution. Where possible, document an expected package tarball hash and validate it independently. 4. Avoid bare `npx @harris7/obclip` because it can download and execute a newly resolved release. If `npx` is necessary, specify an exact version and prevent fallback to unexpected packages. 5. Disable lifecycle scripts during installation when the reviewed package can operate without them. If lifecycle scripts are required, inspect them and all transitive dependencies before allowing execution. 6. Run the CLI in a restricted environment with minimal filesystem permissions, limited network access, and no unrelated credentials. 7. Continue requiring a dedicated browser profile, and document that the profile should contain only the minimum authentication state needed for the target site. ]]>
