T08 · Insecure Dependencies
- Location
scripts/imiva_mcp.py:13- Finding
Automatic Execution of an Unpinned npm Dependency with Sensitive Environment Access
- Content
View full analysis
Vulnerability Details
File Locations:
scripts/imiva_mcp.py:13scripts/imiva_mcp.py:54-62references/mcp-config.example.json:4-10SKILL.md:65SKILL.md:103-110
Vulnerability Type: T08: Insecure Dependencies
Risk Level: MediumVulnerable Code
scripts/imiva_mcp.py:13:python PACKAGE = "@infimind/ecom-content-cli@latest"scripts/imiva_mcp.py:54-62:python 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, )references/mcp-config.example.json:4-10:json "command": "npx", "args": [ "-y", "@infimind/ecom-content-cli@latest" ], "env": { "MCP_TOKEN": "your-token-here", "API_URL": "https://imiva.ecpro.com" }SKILL.md:103-110:json "command": "npx", "args": [ "-y", "@infimind/ecom-content-cli@latest" ], "env": { "MCP_TOKEN": "your-token-here", "API_URL": "https://imiva.ecpro.com" }Technical Analysis
The project executes
@infimind/ecom-content-cli@latestusingnpx -y. Thelatesttag is mutable, so the code executed during a future invocation may differ from the dependency version that was available during this audit. The-yoption suppresses the installation confirmation, allowing the current package release to be downloaded and executed automatically.The helper also constructs the child environment with
os.environ.copy(). Consequently, the downloaded npm package receives not only the requiredMCP_TOKENand API URL but also every other environment variable exported to the parent process. These variables may contain unrelated cloud credentials, API keys, repository tokens, or other sens ...[truncated 1984 chars]- Remediation
View remediation
Remediation Suggestions
-
Replace the mutable
@latestreference with an exact, reviewed package version in the Python constant, example configuration, and documentation:python PACKAGE = "@infimind/ecom-content-cli@1.2.3" -
Use a controlled dependency installation process with a committed lockfile and npm integrity verification. Review and test new versions before deliberately updating the pinned version.
-
Avoid downloading executable dependencies during normal Skill invocation. Install the approved version ahead of time and invoke its verified local executable.
-
Construct a minimal child-process environment rather than copying the complete parent environment. Pass only variables required for execution, such as a restricted
PATH,MCP_TOKEN, andAPI_URL.python env = { "PATH": os.environ.get("PATH", ""), "MCP_TOKEN": token, "API_URL": os.environ.get( "IMIVA_API_URL", os.environ.get("API_URL", DEFAULT_API_URL), ), } -
Run the MCP package in a sandbox or isolated service account with restricted filesystem and network permissions where practical.
-
Scope the IMIVA token to the minimum necessary permissions, rotate it regularly, and monitor it for unexpected API calls or billable operations.
-
Establish a dependency-update policy that includes package provenance checks, release review, vulnerability scanning, and explicit approval before changing the pinned version.
-
