T08 · Insecure Dependencies
- Location
scripts/imiva_mcp.py:14- Finding
Unpinned npm Dependency Enables Mutable Remote Code Execution
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is purpose-aligned for IMIVA ecommerce content generation, but it needs review because it runs an unpinned remote npm package and forwards the full local environment to it.
Install only if you trust the IMIVA/npm package path and are comfortable running downloaded code locally. Prefer a pinned package version, run it in a restricted environment, provide a narrowly scoped revocable MCP token, and avoid invoking it from shells that contain unrelated cloud, repository, or production secrets.
scripts/imiva_mcp.py:14Unpinned npm Dependency Enables Mutable Remote Code Execution
scripts/imiva_mcp.py:51Child Process Receives the Entire Parent Environment and Supports an Unrestricted Credential Destination
os.environ.copy() forwards the entire parent environment into the spawned npm process, not just the intended token and API URL. If the remote package or any dependency is malicious or compromised, it may read unrelated secrets from inherited variables such as cloud credentials, CI tokens, proxies, or internal endpoints.
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 documents shell commands, environment-variable use, and local file access patterns, but it does not declare any explicit tool scope such as allowed-tools or permissions. In an agent environment, that increases the chance the skill is invoked with broader-than-necessary capabilities, enabling unintended file reads, shell execution, or exposure of sensitive environment data if the runtime does not sandbox strictly.
The description contains broad English routing text such as 'Use this skill for IMIVA ecommerce content...' that can match many generic ecommerce requests. Overbroad trigger phrasing can cause accidental skill selection, leading the agent to inappropriately access local files, invoke external services, or steer users into this workflow when a narrower skill would be safer and more appropriate.
The metadata sets language: zh-CN, and the document later emphasizes it is for "中文用户". This indicates a language/locale constraint in the skill's natural-language behavior, but the file does not offer user opt-in or explain a necessary region-specific reason for enforcing that language scope.
The code reads MCP_TOKEN from the environment and then passes it into the spawned subprocess environment. Although the token is required for functionality, this file does not include a user-facing warning, comment, or documentation note explaining that a credential will be consumed and exposed to the child process.
The code launches npx -y @infimind/ecom-content-cli@latest, which can fetch and execute a remote npm package at runtime. Using the mutable latest tag means the exact code executed is not pinned or reviewed in advance, creating a software supply-chain execution risk if the package or dependency chain is compromised.
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 subprocess execution path silently invokes a remote npm package without warning the operator that code may be downloaded and run from the network. In a security-sensitive enterprise skill, hidden remote code execution significantly increases trust and supply-chain risk, especially because the package spec uses @latest.
The script's error messages and command descriptions are written in Chinese, and there is no indication that language selection is configurable or that the tool is intentionally limited to Chinese-speaking users. This can violate language/locale policy where skills should not force a specific language without user opt-in or explicit justification.