T08 · Insecure Dependencies
- Location
scripts/imiva_mcp.py:14- Finding
Automatic Execution of an Unpinned npm Package with Inherited Credentials
- 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, ) ``` `references/mcp-config.example.json:4-9`: ```json "command": "npx", "args": [ "-y", "@infimind/ecom-content-cli@latest" ], "env": { ``` `SKILL.md:87-93`: ```json "command": "npx", "args": [ "-y", "@infimind/ecom-content-cli@latest" ], "env": { "MCP_TOKEN": "your-token-here", ``` ### Technical Analysis The executable dependency is identified using the mutable npm tag `@latest` rather than an audited, exact version. The `npx -y` invocation automatically obtains and executes whichever release the package registry resolves as the latest version at runtime, without an interactive installation confirmation. Consequently, reviewing the repository does not establish the identity or integrity of the code that will execute during a future Skill invocation. A later package release can change the effective executable payload without any modification to this repository. The exposure is amplified by the child-process environment. The helper copies the complete parent environment with `os.environ.copy()`, explicitly adds `MCP_TOKEN`, and supplies that environment to the remotely obtaine ...[truncated 2017 chars]- Remediation
View remediation
