T08 · Insecure Dependencies
- Location
scripts/setup.sh:7- Finding
Unverified Third-Party npm Package Executes with Access to a Wallet Private Key
- Content
View full analysis
Vulnerability Details
File Location:
scripts/setup.sh:7-8(related execution instruction atscripts/setup.sh:27; additional package instructions atSKILL.md:49-69)
Vulnerability Type: Third-party supply-chain exposure without local source or integrity verification
Risk Level: HighVulnerable code:
bash echo "Installing Haggle Protocol MCP Server v0.2.0..." npm install -g @haggle-protocol/mcp@0.2.0The installed package is subsequently executed as follows:
bash echo "Run: npx @haggle-protocol/mcp@0.2.0"The Skill documentation also directs users to install or execute additional externally hosted packages:
bash npm install -g @haggle-protocol/mcp@0.2.0bash npx @haggle-protocol/mcp@0.2.0bash npm install @haggle-protocol/evm@0.1.0 # For Base/Monad/Arbitrum npm install @haggle-protocol/solana@0.1.0 # For Solana npm install @haggle-protocol/core@0.1.0 # Shared typesbash npx @haggle-protocol/api@0.1.0Technical Analysis
The setup script globally installs an npm package whose implementation is not included in the audited project. npm installation may execute package lifecycle scripts, while global installation permits the package to modify the global npm installation area and expose executable commands on the host. The package is then executed through
npxin an environment that may containHAGGLE_PRIVATE_KEY.Exact package versions are specified, which reduces uncontrolled version drift, but the project provides no lockfile, verified package digest, signed provenance, vendored source, or other mechanism to validate the installed artifact. Consequently, claims in
SKILL.mdthat the private key is never transmitted and that no telemetry exists cannot be verified from the supplied files.The local shell script does not print or transmit the private key itself. The vulnerability arises from granting unaudited extern ...[truncated 1897 chars]
- Remediation
View remediation
Remediation Suggestions
- Vendor and audit the exact MCP package and all transitive dependencies, or include their reviewed source in the distributed Skill.
- Use a project-local installation with a committed lockfile instead of
npm install -gand avoidnpxfetching or resolving code at runtime. - Pin and verify package integrity using trusted cryptographic digests, signed release artifacts, and npm provenance attestations. Validate the resolved tarball before installation.
- Disable npm lifecycle scripts where compatible, such as with
npm install --ignore-scripts, and explicitly review any lifecycle script that is operationally required. - Execute the package inside a sandbox or isolated container under an unprivileged account, with a minimal filesystem view and outbound network access restricted to documented blockchain RPC endpoints.
- Do not expose a raw private key to a general-purpose dependency process. Prefer a policy-controlled signer, hardware-backed key, delegated session key, or wallet service that enforces destination, contract, chain, amount, and spending limits.
- Use a dedicated wallet containing only the minimum required funds. Grant exact token allowances, revoke allowances after use, and monitor the wallet for unexpected transactions.
- Document the verified package hash and dependency tree so operators can reproduce and independently validate the reviewed build.
