T08 · Insecure Dependencies
- Location
scripts/imiva_mcp.py:13- Finding
Mutable npm Package Is Automatically Downloaded and Executed with Sensitive Environment Variables
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill matches its ecommerce image workflow purpose, but it needs Review because it runs an unpinned npm MCP client with inherited environment secrets and exposes a broad MCP tool-call helper.
Review this before installing. Use it only with a narrowly scoped, revocable IMIVA token and avoid running it in an environment that contains unrelated API keys or cloud credentials. Prefer a pinned reviewed version of the npm client and a minimal environment allowlist before operational use, and verify which MCP tools the token can access before allowing the generic call helper.
scripts/imiva_mcp.py:13Mutable npm Package Is Automatically Downloaded and Executed with Sensitive Environment Variables
The skill is presented as a dedicated cross-category viral image transformation workflow, but the referenced usage patterns show a generic MCP client that can list tools and invoke arbitrary tool names. That mismatch is dangerous because users and orchestrators may trust the skill with permissions appropriate for one narrow function while it can actually reach additional token-authorized capabilities, expanding the attack surface and enabling privilege misuse.
Using os.environ.copy() passes the full parent environment into a child process that executes externally sourced npm code. If the host environment contains additional secrets, cloud credentials, CI tokens, proxy settings, or internal configuration, the child process gains access to all of them, magnifying the impact of any compromised package or unexpected tool behavior.
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(
The skill exposes shell, file-read, and environment-dependent behaviors without declaring any explicit tool scope or allowlist, so a host agent may grant broader capabilities than users expect. In context, the document instructs use of local files, environment tokens, and command execution, which increases the risk of unintended access to sensitive files or secrets if the wrapper script or agent follows those instructions automatically.
The description explicitly says the skill is especially suitable for '中文用户', which imposes a language/locale preference in natural language. The file does not offer an opt-in choice for other languages or explain a necessary compliance or region-specific reason for restricting the skill to Chinese users.
The display name, short description, and default prompt are all written exclusively in Chinese, which indicates a language-specific interaction requirement. The file does not provide any opt-in, alternative locale, or justification that this skill is intentionally region-specific, so it appears to impose a language constraint contrary to the stated policy.
The script reads MCP_TOKEN from the environment and then injects it into the child process environment for the npm-based MCP client. While the error message explains that the token must be provided, there is no explicit warning that the credential will be passed to a subprocess or used in external network-backed tooling.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
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,
The code runs npx -y @infimind/ecom-content-cli@latest, which fetches and executes a remote npm package at runtime without pinning a version or clearly warning the operator. This introduces supply-chain risk: a compromised upstream package, malicious publish, or unexpected latest-version behavior would execute code in the local environment with access to the provided token and inherited environment.
The wrapper advertises a narrowly scoped ecommerce image-migration skill, but the implementation accepts an arbitrary tool name and forwards arbitrary arguments to tools/call. That creates a capability-expansion issue: any IMIVA MCP tool available to the token can be invoked, which breaks least privilege and could expose unrelated high-impact actions through a misleadingly narrow skill surface.
The script's user-visible error messages are written only in Chinese, and the CLI description/help text also uses Chinese. There is no indication that this tool is intentionally restricted to Chinese-speaking users or any mechanism for opting into another language.