T08 · Insecure Dependencies
- Location
scripts/imiva_mcp.py:14- Finding
Mutable npm Dependency Is Downloaded and Executed Without Verification
- Content
View full analysis
dict: npx, token = require_runtime() env = os.environ.copy() env["MCP_TOKEN"] = token env["API_URL"] = os.environ.get("IMIVA_API_URL", os.environ.get("API_URL", DEFAULT_API_URL)) proc = subprocess.Popen( [npx, "-y", PACKAGE], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, bufsize=1, env=env, ) ``` The same unsafe dependency specification is presented in the example configuration: ```json { "mcpServers": { "imiva-ecommerce": { "command": "npx", "args": [ "-y", "@infimind/ecom-content-cli@latest" ], "env": { "MCP_TOKEN": "your-token-here", "API_URL": "https://imiva.ecpro.com" } } } } ``` ### Technical Analysis The helper invokes `npx -y @infimind/ecom-content-cli@latest`. The `latest` tag is mutable, so the code executed during a future invocation may differ from the code that was available when the Skill was audited. The `-y` option suppresses the normal installation confirmation, allowing the package to be fetched and executed without explicit user review. This creates a supply-chain trust boundary in which control of the package publisher account, npm package, release process, or mutable distribution tag can change the effective executable payload after this repository has been reviewed. The child process also receives `MCP_TOKEN` and a copy of the parent environment. Consequently, a compromised dependency ...[truncated 1547 chars]- Remediation
View remediation
