T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:43
- Finding
- Unpinned Remote npm Package Installation and Execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 43–44 **Vulnerability Type**: Unpinned third-party dependency installation and automatic remote package execution **Risk Level**: Medium ### Vulnerable Code ```bash # 1. Install (see runcomfy-cli skill for details) npm i -g @runcomfy/cli # or: npx -y @runcomfy/cli --version ``` ### Technical Analysis The Skill directs the agent or user to install or execute `@runcomfy/cli` without pinning a reviewed version or verifying package integrity. Both variants resolve mutable content from the npm registry: - `npm i -g @runcomfy/cli` installs the registry's currently selected release globally and may execute npm lifecycle scripts with the invoking user's privileges. - `npx -y @runcomfy/cli --version` automatically downloads and executes the selected release without interactive confirmation. Consequently, the code ultimately executed can change after the Skill has been audited. The package name is consistent with the declared RunComfy service, and the audited file contains no evidence that the current package is malicious. Nevertheless, an npm publication-account compromise, registry compromise, or malicious future release could convert these instructions into an arbitrary-code execution path. The global installation option also exceeds the minimum modification scope needed for a single generation operation. A project-local, locked dependency would reduce system-wide changes and make the installed artifact reproducible. ### Attack Path 1. An attacker compromises the npm account, publication token, upstream build process, or distribution channel associated with `@runcomfy/cli`. 2. The attacker publishes a malicious release under the legitimate package name. 3. A user or agent follows the Skill instructions after the malicious release becomes the registry-selected version. 4. `npm i -g` downloads and installs the malicious package, potentially executing installation lifecycle scripts. A ...[truncated 1244 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin the CLI to a specific reviewed version: ```bash npm install --save-exact @runcomfy/cli@<reviewed-version> ``` 2. Use a project-local dependency and committed lockfile instead of a global installation: ```bash npm ci npx --no-install runcomfy --version ``` 3. Commit and review `package-lock.json`, and use `npm ci` so dependency resolution is reproducible. 4. Publish an expected npm integrity value or cryptographic checksum through a trusted channel and verify the downloaded artifact before execution. 5. Avoid `npx -y` because it permits automatic retrieval and execution without confirmation. If npx is necessary, specify an exact version and require explicit user approval before the initial download. 6. Run the CLI in a restricted container or sandbox with access only to the required input and output files. Do not expose unrelated home-directory content or environment variables. 7. Provide `RUNCOMFY_TOKEN` only to the generation process, use a narrowly scoped token where supported, and rotate it if dependency compromise is suspected. 8. Review package lifecycle scripts and the complete transitive dependency tree before approving a new CLI version. ]]>
