T08 · Insecure Dependencies
- Location
SKILL.md:43- Finding
Unpinned Global Installation of a Security-Sensitive Trading Dependency
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 43
Vulnerability Type: Unpinned third-party executable dependency
Risk Level: HighVulnerable Code
bash npm install -g phemex-trade-mcp@latestTechnical Analysis
The skill instructs users to install the mutable
latestrelease ofphemex-trade-mcpglobally. No exact version, lockfile, package integrity hash, or other reproducible verification mechanism is specified.The installed package is especially security-sensitive because
phemex-clisubsequently receives Phemex API credentials and is authorized to place orders, change leverage, cancel orders, and transfer funds. A Node.js package may also execute package-controlled lifecycle scripts during installation. Because the dependency's source code is not included in the audited project, its installation behavior and credential handling cannot be verified here.This creates a supply-chain trust boundary in which a compromised maintainer account, registry compromise, malicious future release, or transferred package ownership could cause newly installed copies of the skill dependency to execute attacker-controlled code.
Attack Path
- An attacker compromises the npm package, its maintainer account, or its publication process.
- The attacker publishes a malicious release under the mutable
latesttag. - A user follows the documented command and globally installs that release.
- Malicious code executes through an npm lifecycle script or when
phemex-cliis invoked. - The package reads Phemex credentials from environment variables or
~/.phemexrc. - The attacker exfiltrates the credentials, performs unauthorized trades, or executes code with the privileges of the installing user.
Impact Assessment
Successful exploitation could provide code execution under the account running npm, access to environment variables and user-readable files, and theft of Phemex API credentia ...[truncated 341 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace
@latestwith an exact, reviewed version, such asphemex-trade-mcp@1.2.0. - Record and verify package integrity using a lockfile and registry-provided integrity hashes.
- Prefer a project-local installation over a global installation to reduce exposure and improve reproducibility.
- Audit and vendor the dependency implementation where practical, particularly installation scripts, credential access, network destinations, and order-validation logic.
- Disable lifecycle scripts during installation when they are unnecessary, for example with
npm install --ignore-scripts, after verifying that the package remains functional. - Establish a controlled upgrade process that reviews release diffs before changing the pinned version.
- Run the CLI with a dedicated, least-privileged API key that cannot withdraw funds and has only the permissions required for the requested operation.
- Replace
