T08 · Insecure Dependencies
- Location
executor.py:216- Finding
Unpinned Third-Party Dependencies Permit Supply-Chain Payload Substitution
- Content
View full analysis
Vulnerability Details
File Location:
executor.py:216-241; additional references inpackage.json:5-6andSKILL.md:56-57, 197-198, 364
Vulnerability Type: Unpinned third-party package installation
Risk Level: MediumVulnerable Code
python def run_install_deps() -> None: """Install missing dependencies (mcp, futu-stock-mcp-server).""" installed = [] # mcp package if not HAS_MCP: try: subprocess.run([sys.executable, "-m", "pip", "install", "mcp"], check=True, capture_output=True) installed.append("mcp") except subprocess.CalledProcessError as e: print(f"Failed to install mcp: {e}", file=sys.stderr) sys.exit(1) # futu-mcp-server if shutil.which("futu-mcp-server") is None: ok = False if shutil.which("pipx"): try: subprocess.run(["pipx", "install", "futu-stock-mcp-server"], check=True, capture_output=True) installed.append("futu-stock-mcp-server") ok = True except subprocess.CalledProcessError as e: print(f"pipx install failed: {e}", file=sys.stderr) if not ok and shutil.which("pip"): try: subprocess.run([sys.executable, "-m", "pip", "install", "futu-stock-mcp-server"], check=True, capture_output=True) installed.append("futu-stock-mcp-server") ok = True except subprocess.CalledProcessError as e: print(f"pip install failed: {e}", file=sys.stderr)The package setup script contains the same unsafe installation pattern:
json "scripts": { "setup": "pip install mcp" }Technical Analysis
Both
mcpandfutu-stock-mcp-serverare installed without exact version constraints, cryptographic hashes, or a reviewed lockfile. Consequently, the effective code installe ...[truncated 2005 chars]- Remediation
View remediation
Remediation Suggestions
- Pin every dependency to an explicitly reviewed version, for example:
bash python -m pip install "mcp==REVIEWED_VERSION" pipx install "futu-stock-mcp-server==REVIEWED_VERSION" - Maintain a lockfile or requirements file containing cryptographic hashes and install with hash enforcement:
bash python -m pip install --require-hashes -r requirements.txt - Pin build-time and transitive dependencies as well as direct dependencies.
- Replace
package.json's unpinned setup command with a controlled installation script that consumes the reviewed lockfile. - Avoid automatic dependency installation during normal Skill execution. Fail closed with clear installation instructions when dependencies are absent.
- Retrieve packages only from an approved package index over TLS, and consider an internal artifact repository containing reviewed artifacts.
- Run dependency installation and the MCP server in a dedicated, unprivileged virtual environment or isolated service account.
- Add automated dependency scanning and require security review before updating pinned versions or hashes.
- Pin every dependency to an explicitly reviewed version, for example:
