T08 · Insecure Dependencies
- Location
scripts/imiva_mcp.py:14- Finding
Automatic Execution of an Unpinned npm Package
- Content
View full analysis
Vulnerability Details
File Location:
scripts/imiva_mcp.py:14, 49-60; also referenced inSKILL.md:46, 86-91andreferences/mcp-config.example.json:4-8
Vulnerability Type: Unpinned third-party executable dependency
Risk Level: MediumComplete Code Snippet
python PACKAGE = "@infimind/ecom-content-cli@latest" DEFAULT_API_URL = "https://imiva.ecpro.com"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 example configuration independently recommends the same behavior:
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 wrapper invokes
npx -y @infimind/ecom-content-cli@latest. Thelatesttag is mutable, so the code executed during a future invocation may differ from the version available at audit time. The-yoption removes the interactive installation confirmation.Consequently, the effective executable is neither pinned nor contained in the reviewed project. A compromised npm publisher account, package registry compromise, or malicious future package release could introduce arbitrary code without requiring any change to this repository.
This issue is classified as an insecure dependency because execution depends on a mutable package release obtained fr ...[truncated 1426 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace the mutable
@latestreference with an exact, reviewed package version, such as@infimind/ecom-content-cli@x.y.z. - Use a lockfile that records the complete transitive dependency graph and package integrity hashes.
- Install dependencies during a controlled setup phase rather than downloading executable code whenever the Skill is invoked.
- Run automated vulnerability and provenance checks against the pinned package and all transitive dependencies.
- Where possible, verify npm package signatures, registry provenance attestations, and expected integrity hashes.
- Consider vendoring the reviewed client or using a locally installed, integrity-verified executable.
- Execute the MCP process in a sandbox with restricted filesystem and network access.
- Update
SKILL.mdandreferences/mcp-config.example.jsonso they do not instruct users to run the mutablelatestrelease.
- Replace the mutable
