T08 · Insecure Dependencies
- Location
scripts/imiva_mcp.py:14- Finding
Mutable npm Dependency Executes with Access to the Complete Parent Environment
- Content
View full analysis
Vulnerability Details
File Location:
scripts/imiva_mcp.py:14,scripts/imiva_mcp.py:48-62,SKILL.md:84-96,references/mcp-config.example.json:3-12
Vulnerability Type: Mutable third-party dependency execution and excessive environment inheritance
Risk Level: HighThe skill invokes
npx -ywith the mutable npm package specifier@infimind/ecom-content-cli@latest. The package is downloaded and executed without an exact version, lockfile, or integrity constraint. The resulting subprocess receives a copy of the complete parent environment.Relevant implementation:
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 recommended configuration also uses the mutable package reference:
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 npm
latesttag is mutable. The code reviewed during this audit is therefore not sufficient to determine which third-party package version will execute during a future invocation. The-yoption allowsnpxto install and execute the resolved package without an interactive installation confirmation.No package lockfile, exact semantic version, or integrity hash constrains the down ...[truncated 2552 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace
@infimind/ecom-content-cli@latestwith an audited, exact package version in the Python script,SKILL.md, and the example MCP configuration. - Install the dependency through a committed lockfile that records package integrity hashes. Use a reproducible installation command such as
npm cirather than downloading a mutable dependency during each normal invocation. - Consider vendoring or preinstalling the verified dependency so runtime operation does not automatically retrieve and execute new code.
- Add an explicit dependency-update process that includes code review, vulnerability scanning, integrity verification, and controlled lockfile updates.
- Replace
os.environ.copy()with a minimal environment allowlist. Pass only variables strictly required for process execution, such as a controlledPATH,MCP_TOKEN, andAPI_URL. - Run the MCP package in a sandbox or restricted service account with limited filesystem and network access.
- Avoid placing unrelated secrets in the parent environment used to launch this skill. Use narrowly scoped, short-lived tokens and rotate
MCP_TOKENif package compromise is suspected. - Apply the same exact-version requirement to every documented configuration so users do not bypass the hardened Python helper and execute the mutable package directly.
- Replace
