T08 · Insecure Dependencies
- Location
SKILL.md:43- Finding
Unpinned Global Installation of a Mutable Third-Party Package
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 43–48
Vulnerability Type: Unpinned third-party dependency installed globally
Risk Level: HighVulnerable Code:
markdown ## Before you start Ensure you have the latest version installed: ```bash npm install -g phemex-cli@latesttext ### Technical Analysis The Skill instructs users to install `phemex-cli` globally from npm using the mutable `@latest` distribution tag. The package version and integrity are therefore determined at installation time rather than review time. The repository contains no executable implementation of the CLI, lockfile, integrity hash, or vendored source that would allow the effective runtime code to be audited as part of this project. npm packages may execute lifecycle scripts during installation and arbitrary code when invoked. Because installation is global, package executables are exposed through the user's global command path. The package subsequently receives access to the Phemex API key and secret required by the Skill. A malicious future release, compromised publisher account, or compromised package could consequently execute with the installing user's operating-system privileges and obtain financially sensitive credentials. ### Attack Path 1. An attacker compromises the npm package, its publisher account, or a release process and publishes a malicious version under the `latest` tag. 2. A user follows the documented command `npm install -g phemex-cli@latest`. 3. npm resolves the mutable tag to the attacker-controlled version. 4. Malicious code executes through an installation lifecycle script or when the globally installed `phemex-cli` command is invoked. 5. The package reads `PHEMEX_API_KEY`, `PHEMEX_API_SECRET`, or `~/.phemexrc`, or manipulates trading commands and responses. 6. The attacker may exfiltrate credentials, perform unauthorized API operations within the key's permissions, or execute other ...[truncated 589 chars]- Remediation
View remediation
Remediation Suggestions
- Replace
@latestwith an exact, reviewed package version; do not use a range or mutable distribution tag. - Verify and document the expected npm publisher, package provenance, source repository, and release signature or integrity digest.
- Commit a lockfile with integrity metadata where the installation model permits it.
- Prefer a project-local installation over a global installation to reduce command-path exposure and simplify version control.
- Install with lifecycle scripts disabled when they are not required, and separately review any lifecycle scripts before enabling them.
- Audit the resolved package and its transitive dependencies before each approved upgrade.
- Run the CLI under a dedicated, least-privileged account or sandbox.
- Use a Phemex API key restricted to only the necessary operations and ensure withdrawal permissions are disabled.
- Replace
