T08 · Insecure Dependencies
- Location
SKILL.md:29- Finding
Unpinned Third-Party CLI Installation and Execution
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 29–39
Vulnerability Type: Supply-chain risk caused by installing and executing an unpinned dependency
Risk Level: MediumVulnerable code:
bash Make sure the CLI is up to date before running commands: ```bash npm install -g ctx7@latestOr run directly without installing:
bash npx ctx7@latest <command>text ### Technical Analysis The skill explicitly instructs the agent to download and execute the mutable `latest` release of the `ctx7` npm package. Neither command identifies a reviewed, immutable package version or verifies the downloaded artifact's integrity. `npx ctx7@latest` may download package content and execute its binaries immediately. Similarly, `npm install -g ctx7@latest` installs the current registry-selected release globally and may run npm lifecycle scripts during installation. Consequently, the code actually executed can change after the skill has been audited without any modification to `SKILL.md`. This creates a supply-chain trust boundary around the npm registry, the package publisher account, package maintainers, and the local npm registry configuration. A compromised publisher account, malicious future release, registry redirection, or compromised configured registry could cause attacker-controlled code to run when the skill workflow is followed. No evidence in the audited file establishes that the current `ctx7` package is malicious. The confirmed issue is the unsafe use of an unpinned, automatically changing dependency execution mechanism. ### Attack Path 1. An attacker compromises the `ctx7` publishing process or publisher account, publishes a malicious release selected by the `latest` tag, or causes the environment to resolve the package through a malicious npm registry. 2. The agent follows the skill instruction and runs `npm install -g ctx7@latest` or `npx ctx7@latest`. 3. npm retrieves the ...[truncated 1245 chars]- Remediation
View remediation
Remediation Suggestions
- Replace
ctx7@latestwith an exact, reviewed version, such asctx7@X.Y.Z. Do not use mutable tags or semver ranges in executable instructions. - Record and verify the expected package integrity hash before execution. Where feasible, manage the CLI through a project lockfile and use
npm ciso dependency resolution is reproducible. - Avoid global installation. Install the pinned package in a dedicated project or isolated tool directory to limit modifications to the user's global environment.
- Disable lifecycle scripts during installation when they are not required, for example with
npm install --ignore-scripts, and separately review any scripts that must run. - Require the official npm registry explicitly and validate that local or environment-level npm configuration has not redirected package resolution to an untrusted registry.
- Execute the documentation CLI in a sandbox or restricted container with minimal filesystem access, no unnecessary credentials, and constrained outbound network access.
- Establish a controlled update process: review new releases, verify publisher and provenance information, test the package in isolation, and update the pinned version only after approval.
- Replace
