T08 · Insecure Dependencies
- Location
scripts/imiva_mcp.py:14- Finding
Mutable npm Package Is Automatically Downloaded and Executed with Sensitive Credentials
- Content
View full analysis
Vulnerability Details
File Location:
scripts/imiva_mcp.py:14, 50-58; related configuration atSKILL.md:46, 85-89andreferences/mcp-config.example.json:4-8
Vulnerability Type: Unpinned third-party dependency and unattended remote package execution
Risk Level: HighVulnerable Code
python PACKAGE = "@infimind/ecom-content-cli@latest"python def invoke(method: str, params: dict | None = None) -> 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 package selection is recommended in the MCP example:
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
npxwith-yand the mutable npm version specifier@latest. This causes npm to resolve and potentially download whatever package version is associated with thelatestdistribution tag at execution time. The effective executable can therefore change after this Skill has been reviewed.No exact version, lockfile, package integrity hash, signature verification, or locally reviewed installation is used. The downloaded package executes under the user's account and receives
MCP_TOKENalong with the process's inherited environment. This creates a supply-chain trust boundary in which a compromised publisher account, malicious future release, or compro ...[truncated 1451 chars]- Remediation
View remediation
Remediation Suggestions
- Replace
@latestwith an exact, reviewed package version, such as@infimind/ecom-content-cli@X.Y.Z. - Install the dependency through a committed lockfile that records package integrity hashes.
- Remove
-yso that unexpected installation or resolution behavior is not accepted automatically. - Prefer invoking a preinstalled, locally verified executable rather than downloading code during every Skill run.
- Verify package provenance and signatures where the package ecosystem supports them.
- Establish an explicit dependency-upgrade process that includes source review, integrity verification, and security testing before changing the pinned version.
- Run the MCP package in a sandbox with restricted filesystem and network access.
- Pass only the environment variables strictly required by the MCP package rather than inheriting the complete parent environment.
- Replace
