T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:38
- Finding
- Unpinned Third-Party Package Installation and Execution## Vulnerability Details **File Location**: `SKILL.md`, lines 38–40 **Vulnerability Type**: Unpinned and automatically executed npm dependency **Risk Level**: Medium **Vulnerable code:** ```bash # 1. Install (one of — see runcomfy-cli skill for details) npm i -g @runcomfy/cli # global install npx -y @runcomfy/cli --version # zero-install ``` ### Technical Analysis The documented installation commands resolve `@runcomfy/cli` without specifying an exact, previously audited version. Consequently, the package and its transitive dependencies may change after the Skill itself has been reviewed. The `npx -y` command automatically approves package retrieval and execution. The global installation alternative may also run npm lifecycle scripts and places the package in a persistent, broadly accessible installation location. If the package publisher, npm account, registry distribution process, or a transitive dependency is compromised, following these instructions could execute attacker-controlled code with the permissions of the invoking user. The use of a scoped npm package reduces accidental typo-squatting exposure, but it does not protect against compromised releases, maintainer-account takeover, malicious dependency updates, or mutable package tags. ### Attack Path 1. An attacker compromises the `@runcomfy/cli` publishing account, release pipeline, or one of its transitive dependencies. 2. The attacker publishes a malicious package version that is selected by npm because the commands do not pin an exact version. 3. A user or agent follows the instructions in `SKILL.md`. 4. `npm i -g` or `npx -y` downloads the malicious version and executes package code or lifecycle scripts. 5. The payload runs with the invoking user's permissions. 6. The payload may access credentials available to that process, including `RUNCOMFY_TOKEN` or the documented token file at `~/.config/runcomfy/ ...[truncated 790 chars]
- Remediation
- ## Remediation Suggestions 1. Pin `@runcomfy/cli` to an exact, reviewed version rather than resolving the latest available release: ```bash npm install --save-exact @runcomfy/cli@X.Y.Z npx --no-install runcomfy --version ``` 2. Prefer a project-local, lockfile-backed installation over a global installation. Commit and review `package-lock.json`, and use `npm ci` to enforce the locked dependency graph. 3. Avoid `npx -y` for packages that are not already installed and verified. Require explicit operator approval before downloading or executing new package versions. 4. Verify npm package provenance, publisher identity, registry source, integrity hashes, and release signatures where available. 5. Review transitive dependencies and use automated dependency scanning before updating the pinned version. 6. Consider disabling lifecycle scripts during installation with `--ignore-scripts` if the CLI functions correctly without them. If lifecycle scripts are required, document and review each expected script. 7. Run the CLI with least privilege in an isolated environment, expose only the required token and files, and avoid invoking npm as an administrator or root user.
