T08 · Insecure Dependencies
- Location
scripts/imiva_mcp.py:14- Finding
Mutable npm Dependency Is Downloaded and Executed Automatically
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly matches its ecommerce-content purpose, but it runs a mutable external npm MCP package with broad environment-variable access and permissive invocation behavior that users should review before installing.
Install only if you trust the IMIVA npm MCP package and are comfortable with it receiving your MCP token and any environment variables present when the helper runs. Prefer a pinned package version, a minimal environment, explicit user confirmation before paid generation, and manual invocation for specific Tmall tasks rather than broad implicit use.
scripts/imiva_mcp.py:14Mutable npm Dependency Is Downloaded and Executed Automatically
scripts/imiva_mcp.py:51Third-Party MCP Process Inherits the Complete Parent Environment
The skill is advertised as a narrow Tmall ecommerce content workflow, but its documented behavior includes generic tool discovery and the ability to invoke broadly available MCP functionality without enforcement of task-specific limits. This mismatch is dangerous because users and higher-level agents may trust the description while the actual capability surface is much wider, enabling unintended actions, data access, or misuse of privileged tools.
The code copies the entire parent environment with os.environ.copy() and passes it to a network-fetched external CLI. That needlessly exposes all ambient secrets and configuration in the current process environment—not just MCP_TOKEN—to the child package, which is especially risky here because the package is invoked through npx and may change over time.
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-variable access but does not declare any explicit tool scope or allowed-tools boundary. In practice, this creates an over-privileged skill surface where natural-language requests or embedded workflow steps could cause access to secrets, local files, or arbitrary command execution beyond the stated ecommerce purpose.
The manifest description ends with 'Use this skill for IMIVA ecommerce content, product images, product detail pages, KOC seeding, product video, viral creative recreation, marketplace listing and social commerce workflows.' This reads like a broad activation description rather than a narrowly scoped trigger, and several phrases such as 'product images' or 'marketplace listing' are common requests that could match many unrelated conversations.
The description states the skill is especially suitable for '中文用户', and the example task arguments hard-code 'language':'简体中文' rather than presenting language as a user choice. Under the policy, locale constraints should be optional or clearly justified as region-specific; here the file targets Tmall but does not explicitly state that output language is mandatory or user-selectable.
The skill enables allow_implicit_invocation without any visible trigger restrictions, scope limits, or exclusion conditions. That means the agent may auto-select this commerce-content skill in broader conversations than intended, potentially sending user prompts or business assets into content-generation workflows without clear user intent or confirmation.
This code reads the MCP_TOKEN environment variable and later injects it into the child process environment for the spawned MCP client. Although the script validates presence of the token, it does not provide a user-facing warning, log message, or comment disclosing that a credential will be consumed and forwarded to an external package process.
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 script executes an external package via npx using @infimind/ecom-content-cli@latest, which can fetch and run code that is not pinned to a known version. In an enterprise ecommerce skill that handles authenticated content-generation workflows, this creates a significant supply-chain risk: a compromised or malicious package update would run with access to the user's environment, including MCP credentials.
The script's user-facing error messages are written only in Chinese, and there is no indication that the skill is intentionally region-specific or that users can opt into another language. This can violate language/locale policy when a skill implicitly forces a language without documented justification.