T08 · Insecure Dependencies
- Location
scripts/imiva_mcp.py:13- Finding
Unpinned Remote npm Package Is Automatically Downloaded and Executed
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a coherent IMIVA commerce-content helper, but it needs Review because it runs a changing npm package with the user's token and inherited environment.
Install only if you trust the IMIVA service and the @infimind npm package supply chain. Use a dedicated, low-privilege IMIVA token, run it from a clean environment or sandbox with unnecessary secrets removed, confirm budget before task creation, and prefer a pinned reviewed package version before production use.
scripts/imiva_mcp.py:13Unpinned Remote npm Package Is Automatically Downloaded and Executed
os.environ.copy() forwards the entire parent environment into the spawned npm process, not just the intended API settings. That broad exposure can leak unrelated secrets such as cloud credentials, CI tokens, proxies, and internal configuration to third-party code, which is especially risky here because the subprocess is launched from a remotely resolved npm package.
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(
Without declared permissions the skill's intent is opaque and cannot be validated.
The example task payload hard-codes "language":"简体中文", which signals a fixed locale in the skill's natural-language guidance. The file does not pair this with an explicit user opt-in or alternative language choice, so it can be read as enforcing a specific language policy rather than offering one.
This scenario again embeds "language":"简体中文" in the recommended request body, reinforcing a mandatory locale in the skill instructions. Because the document does not explicitly offer a language-selection path, this natural-language guidance conflicts with the requirement to avoid forcing a locale without user opt-in.
The skill enables implicit invocation without any visible activation constraints, confirmation requirements, or narrow triggering conditions. That creates a real risk that the agent may invoke this commerce-optimization workflow automatically in response to loosely related user requests, causing unintended data sharing, confusing task execution, or unauthorized downstream actions such as creating optimization tasks based on user-provided assets and budget context.
The script reads MCP_TOKEN from the environment and forwards it to an external subprocess, which means the token is exposed to all code executed within that npm package and its dependencies. Even if intended for authentication, this is dangerous without explicit disclosure and scoping because a malicious or compromised package could exfiltrate the credential.
The code spawns an external process using npx -y @infimind/ecom-content-cli@latest, which downloads and executes code outside the Python package trust boundary. Because it targets the mutable latest tag and runs with inherited environment variables and a live MCP token, compromise of the npm package, dependency chain, or registry response could lead to arbitrary code execution and credential exposure.
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,
This skill's stated purpose is PDP/content optimization, but it achieves that by launching a remotely resolved npm package via npx, which expands capability from content orchestration to arbitrary third-party code execution. That creates a meaningful supply-chain and runtime-execution risk inconsistent with a narrow helper script unless explicitly constrained and disclosed.
Executing an external package through npx runs code retrieved from the npm ecosystem, but this file provides no explicit warning that third-party code will be installed and executed. In combination with the latest tag and token forwarding, this materially increases the risk of silent supply-chain compromise and user surprise.
The error messages presented to users are written only in Chinese, with no mechanism to select another language or locale. This creates a language-policy concern because the skill imposes a specific language on all users regardless of preference or environment.
The command description and subcommand help strings are only in Chinese, so all users receive a fixed locale with no opt-in or selection. This is a natural-language policy issue unless the tool is explicitly documented as region- or language-specific.