T08 · Insecure Dependencies
- Location
SKILL.md:18- Finding
Unpinned Global Installation of a Third-Party CLI Package
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 18-21
Vulnerability Type: Unpinned third-party dependency installed globally
Risk Level: MediumVulnerable Code
markdown If not installed, run: ```bash npm install -g @qwencloud/qwencloud-clitext ### Technical Analysis The Skill instructs the agent to install `@qwencloud/qwencloud-cli` from npm without specifying a reviewed version or integrity value. Consequently, the package contents installed at runtime may differ from those reviewed when the Skill was published. npm installation can execute package lifecycle scripts. The `-g` option also installs the package globally rather than confining it to a project-local environment, increasing its filesystem reach and making its executable available to other sessions. This is particularly sensitive because the installed CLI subsequently handles QwenCloud authentication credentials, account usage, and billing information. The audit did not establish that the referenced package is currently malicious. The vulnerability is the unsafe and mutable dependency installation process, which creates a supply-chain execution path if the package, its publisher account, or a transitive dependency is compromised. ### Attack Path 1. An attacker compromises the npm publisher account, the package release process, or a transitive dependency used by `@qwencloud/qwencloud-cli`. 2. The attacker publishes a malicious release under the same package name or introduces a malicious lifecycle script into the dependency chain. 3. The Skill is invoked on a system where `qwencloud` is not installed. 4. Following the Skill instructions, the agent executes `npm install -g @qwencloud/qwencloud-cli`. 5. npm retrieves the mutable latest release and may execute attacker-controlled lifecycle scripts with the privileges of the user running the installation. 6. The malicious package can modify user-accessible files, replace the ...[truncated 665 chars]- Remediation
View remediation
Remediation Suggestions
- Pin the CLI to a specific version that has been reviewed, for example:
bash npm install --save-exact @qwencloud/qwencloud-cli@<reviewed-version> - Record and verify package integrity through a committed lockfile or an equivalent trusted checksum mechanism.
- Prefer a project-local, isolated installation over
npm install -gso the package cannot broadly affect the user's command environment. - Require explicit user approval before installing any missing dependency; do not allow the agent to install it automatically.
- Verify that the package originates from the expected npm registry and official publisher before installation.
- Review package lifecycle scripts and transitive dependencies. Where compatible with the verified package, disable installation scripts using
--ignore-scripts. - Execute the CLI under a minimally privileged account or sandbox with access limited to the credential and network resources required for QwenCloud operations.
- Reassess and approve dependency upgrades instead of automatically consuming the latest release.
- Pin the CLI to a specific version that has been reviewed, for example:
