Back to skill

Security audit

AI电商专家|批量商品视频变体

Security checks for vulnerabilities and agentic risk

Overview

The skill’s video-generation purpose is mostly coherent, but it runs an unpinned external npm MCP client with sensitive credentials and a broad inherited environment, so users should review it before installing.

Install only if you trust the IMIVA npm package supply chain and are comfortable giving it an MCP token. Use a narrowly scoped, revocable token with spending limits, avoid running it from shells that contain unrelated secrets, do not rely on a generic API_URL environment variable, and require an explicit dry-run plus budget confirmation before creating paid video tasks.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (2)

T08 · Insecure Dependencies

Error
Location
scripts/imiva_mcp.py:14
Finding

Unpinned npm Package Is Automatically Downloaded and Executed

Content
View full analysis

Vulnerability Details

File Location: scripts/imiva_mcp.py:14-57; SKILL.md:93-104; references/mcp-config.example.json:4-8
Vulnerability Type: Unpinned third-party dependency execution
Risk Level: High

Vulnerable Code

scripts/imiva_mcp.py:

python
PACKAGE = "@infimind/ecom-content-cli@latest"
DEFAULT_API_URL = "https://imiva.ecpro.com"
python
proc = subprocess.Popen(
    [npx, "-y", PACKAGE],
    stdin=subprocess.PIPE,
    stdout=subprocess.PIPE,
    stderr=subprocess.PIPE,
    text=True,
    bufsize=1,
    env=env,
)

references/mcp-config.example.json:

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 helper invokes npx with the -y option and an npm package identified by the mutable latest tag. This causes the current registry release to be retrieved and executed automatically without an interactive confirmation step.

The effective code executed by the Skill can therefore change after the Skill itself has been reviewed. No exact version, package integrity digest, lockfile, or verified local artifact constrains the downloaded dependency. A compromised publisher account, malicious package release, registry compromise, or unsafe future update could introduce arbitrary code that executes with the privileges of the user running the helper.

The child process also receives an environment containing MCP_TOKEN, increasing the sensitivity of this supply-chain boundary.

Attack Path

  1. An attacker compromises the npm package publisher, release pipeline, registry entry, or another mechanism controlling the latest release.
  2. The attacker publishes a modified releas ...[truncated 1242 chars]
Remediation
View remediation

Remediation Suggestions

  1. Replace the mutable latest tag with an exact, reviewed package version, for example:
    python
    PACKAGE = "@infimind/ecom-content-cli@1.2.3"
    
  2. Pin and verify the package's integrity digest through a lockfile or an equivalent trusted dependency-verification mechanism.
  3. Install dependencies during a controlled deployment step instead of downloading executable code during each invocation.
  4. Consider vendoring or preinstalling an audited package artifact and invoking it from a verified local path.
  5. Document the expected npm registry, package publisher, package version, and integrity value.
  6. Review dependency changes before upgrades and use automated supply-chain scanning.
  7. Construct a minimal child-process environment rather than forwarding the complete parent environment.
  8. Update SKILL.md and references/mcp-config.example.json so all documented commands use the same pinned and verified release.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/imiva_mcp.py:50
Finding

Endpoint Override Can Redirect a Credential-Bearing MCP Process

Content
View full analysis

Vulnerability Details

File Location: scripts/imiva_mcp.py:50-64
Vulnerability Type: Unvalidated service endpoint override with sensitive credentials
Risk Level: Medium

Vulnerable Code

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,
    )

Technical Analysis

The helper obtains the destination endpoint from the ambient IMIVA_API_URL environment variable and then falls back to the generic API_URL variable. It forwards that endpoint to the MCP subprocess together with the genuine MCP_TOKEN.

The code does not validate that the configured endpoint:

  • Uses HTTPS.
  • Belongs to the expected imiva.ecpro.com host.
  • Uses an approved port.
  • Has not been supplied through an unexpectedly inherited generic environment variable.

A poisoned shell, development environment, process launcher, CI job, or wrapper script could set API_URL or IMIVA_API_URL to an attacker-controlled destination. The spawned MCP client would then receive both the substituted endpoint and the authentication token. Depending on the downstream client's authentication behavior, it could transmit the token or credential-bearing requests to that destination.

The use of the generic API_URL fallback increases the likelihood of accidental redirection because unrelated applications and deployment environments commonly define variables with that name.

Attack Path

  1. An attacker gains the ability to influence the environment used to start the helper, such as through a malicious wrapper, ...[truncated 1464 chars]
Remediation
View remediation

Remediation Suggestions

  1. Use the fixed production endpoint by default and do not inherit the generic API_URL variable:
    python
    env["API_URL"] = DEFAULT_API_URL
    
  2. If custom endpoints are required, require an explicit command-line option or a clearly scoped configuration setting.
  3. Parse and validate any override with urllib.parse.urlparse.
  4. Require the https scheme and reject embedded credentials, fragments, unexpected ports, and malformed hostnames.
  5. Enforce an allowlist of approved service hosts, such as imiva.ecpro.com.
  6. Require a separate explicit development flag before allowing localhost or test endpoints.
  7. Display the selected destination before sending authenticated requests when an override is active.
  8. Pass a minimal environment to the child process and remove unrelated inherited variables.
  9. Document immediate token revocation and rotation procedures for suspected endpoint-redirection incidents.
  10. Apply server-side least privilege, short token lifetimes, spending limits, and audit logging to reduce the impact of credential theft.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill is presented as a narrowly scoped batch video-variation tool, but its documented workflow includes generic MCP tool enumeration and a dispatcher pattern capable of invoking arbitrary token-authorized tools. That mismatch is dangerous because users may consent to a limited ecommerce video workflow while the implementation can reach a much broader set of operations depending on token scope, violating least privilege and enabling unintended actions or data access.

Content

No source excerpt is available for this finding.

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
91% confidence
Finding

os.environ.copy() forwards the entire parent environment to the spawned npx process, not just the needed token and API URL. That can unintentionally expose unrelated secrets, cloud credentials, proxy settings, or internal configuration to a third-party package fetched and executed at runtime, substantially increasing the blast radius if that package is malicious or compromised.

Content

Scanner excerpt · scripts/imiva_mcp.py (reported line 51)May include surrounding context.

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(

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
85% confidence
Finding

The skill exposes shell, file-read, and environment-dependent behavior without an explicit tool allowlist or permissions boundary. In this context, the documentation instructs users to run local scripts and export secrets, so absent scoping increases the chance that the skill or its helper code could access broader local resources or invoke unintended capabilities beyond the advertised workflow.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest sets language: zh-CN, and the document further narrows the target audience to Chinese users. This is a natural-language locale constraint that does not present an explicit user choice or clear compliance justification, so it can violate language/locale policy requirements.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The phrase indicating the skill is especially suitable for 中文用户 states a specific language audience as a default behavior. Because no alternative language option or opt-in is offered here, this can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The display name, description, and default prompt are all written in Chinese, with no indication that the user can choose another language or locale. This may violate language-choice policy because it imposes a specific language without documented opt-in or justification.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill enables implicit invocation without any visible trigger constraints, so the platform may auto-activate this ecommerce workflow in contexts the user did not clearly intend. Because the skill can initiate real MCP-backed content generation tasks, ambiguous activation increases the risk of unintended tool use, unwanted costs, and accidental processing of business media or URLs.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script emits error/help text in Chinese only, such as the runtime and token setup failures, without offering the user a language choice or documenting a justified locale restriction. The policy for all file types requires flagging language/locale constraints that force a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code reads the MCP_TOKEN credential from the environment and uses it to authenticate downstream operations, but there is no user-facing warning, log message, or explanatory comment/docstring disclosing that a sensitive credential is being accessed. Under the code-file criteria, sensitive environment variable access should be flagged when it lacks any form of disclosure.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
82% confidence
Finding

The code launches an external package via npx -y @infimind/ecom-content-cli@latest, which executes whatever the latest published package resolves to at runtime. Because it also passes authentication material through the subprocess environment, a compromised package release, dependency, or registry response could execute arbitrary code and exfiltrate the MCP token. In this enterprise ecommerce skill context, that risk is elevated because the tool is intended for routine authenticated production use.

Content

Scanner excerpt · scripts/imiva_mcp.py (reported line 54)May include surrounding context.

python
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,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The script invokes an external MCP client subprocess without any explicit user-facing disclosure at execution time. In a skill ecosystem, silent outbound tool execution can surprise operators and mask that third-party code is being run with access to sensitive credentials, increasing the chance of unintended trust and unsafe automation.

Content

No source excerpt is available for this finding.