Back to skill

Security audit

AI电商专家|MCP 电商内容自动化

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent IMIVA ecommerce automation helper, but it runs an unpinned external npm package with a live MCP token and the caller's full environment, which creates a real credential and supply-chain review concern.

Install only if you trust the IMIVA npm package and are comfortable giving it your MCP token. Prefer running it in a clean shell or container with only MCP_TOKEN, API_URL, and PATH set, and ask the publisher to pin the npm package version and avoid copying the full environment before using it in production.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T08 · Insecure Dependencies

Warning
Location
scripts/imiva_mcp.py:13
Finding

Automatic Execution of an Unpinned npm Dependency with Sensitive Environment Access

Content
View full analysis

Vulnerability Details

File Locations:

  • scripts/imiva_mcp.py:13
  • scripts/imiva_mcp.py:54-62
  • references/mcp-config.example.json:4-10
  • SKILL.md:65
  • SKILL.md:103-110

Vulnerability Type: T08: Insecure Dependencies
Risk Level: Medium

Vulnerable Code

scripts/imiva_mcp.py:13:

python
PACKAGE = "@infimind/ecom-content-cli@latest"

scripts/imiva_mcp.py:54-62:

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,
    stderr=subprocess.PIPE,
    text=True,
    bufsize=1,
    env=env,
)

references/mcp-config.example.json:4-10:

json
"command": "npx",
"args": [
  "-y",
  "@infimind/ecom-content-cli@latest"
],
"env": {
  "MCP_TOKEN": "your-token-here",
  "API_URL": "https://imiva.ecpro.com"
}

SKILL.md:103-110:

json
"command": "npx",
"args": [
  "-y",
  "@infimind/ecom-content-cli@latest"
],
"env": {
  "MCP_TOKEN": "your-token-here",
  "API_URL": "https://imiva.ecpro.com"
}

Technical Analysis

The project executes @infimind/ecom-content-cli@latest using npx -y. The latest tag is mutable, so the code executed during a future invocation may differ from the dependency version that was available during this audit. The -y option suppresses the installation confirmation, allowing the current package release to be downloaded and executed automatically.

The helper also constructs the child environment with os.environ.copy(). Consequently, the downloaded npm package receives not only the required MCP_TOKEN and API URL but also every other environment variable exported to the parent process. These variables may contain unrelated cloud credentials, API keys, repository tokens, or other sens ...[truncated 1984 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace the mutable @latest reference with an exact, reviewed package version in the Python constant, example configuration, and documentation:

    python
    PACKAGE = "@infimind/ecom-content-cli@1.2.3"
    
  2. Use a controlled dependency installation process with a committed lockfile and npm integrity verification. Review and test new versions before deliberately updating the pinned version.

  3. Avoid downloading executable dependencies during normal Skill invocation. Install the approved version ahead of time and invoke its verified local executable.

  4. Construct a minimal child-process environment rather than copying the complete parent environment. Pass only variables required for execution, such as a restricted PATH, MCP_TOKEN, and API_URL.

    python
    env = {
        "PATH": os.environ.get("PATH", ""),
        "MCP_TOKEN": token,
        "API_URL": os.environ.get(
            "IMIVA_API_URL",
            os.environ.get("API_URL", DEFAULT_API_URL),
        ),
    }
    
  5. Run the MCP package in a sandbox or isolated service account with restricted filesystem and network permissions where practical.

  6. Scope the IMIVA token to the minimum necessary permissions, rotate it regularly, and monitor it for unexpected API calls or billable operations.

  7. Establish a dependency-update policy that includes package provenance checks, release review, vulnerability scanning, and explicit approval before changing the pinned version.

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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (9)

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
95% confidence
Finding

os.environ.copy() forwards the full parent environment into a subprocess that is launched from an externally resolved npx package. This is dangerous because any unrelated secrets in the caller's environment—not just MCP_TOKEN—become available to child code, materially increasing blast radius if the package is compromised or behaves unexpectedly.

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
88% confidence
Finding

The skill documents and encourages use of shell commands, environment variables, and local file paths, but it does not declare any explicit tool scope such as allowed-tools or permissions. This creates an authorization boundary mismatch: a host or user may not realize the skill expects shell, env, and file access, increasing the risk of overbroad execution, secret exposure, or unintended local file handling when the skill is run by an agent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file declares language: zh-CN, and the surrounding content targets "中文用户" as the expected audience. Because the skill does not present this as an opt-in preference or explain a necessary region-specific compliance constraint, it reads as a fixed language policy rather than a user-selectable option.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The display name, short description, and default prompt are entirely in Chinese, which strongly implies the skill is intended to operate in a fixed language. There is no visible opt-in, language selection mechanism, or documented justification for restricting the interaction locale, which may violate language or locale policy requirements.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill enables implicit invocation (allow_implicit_invocation: true) without any visible trigger constraints, scoping rules, or exclusion conditions. In an agent environment, this can cause the skill to activate unexpectedly for loosely related ecommerce requests and reach real MCP-backed product/content operations, increasing the chance of unintended data access, action execution, or prompt-routing abuse.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script reads MCP_TOKEN from the environment and later injects it into the child process environment for the npx-launched MCP client. While this may be necessary for operation, there is no print, prompt, or comment warning the user that a credential will be consumed and passed to another process.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
92% confidence
Finding

The script spawns an external package via npx at runtime, which causes execution of code outside the reviewed repository. Because the package reference uses @latest, the exact code executed can change over time, creating a supply-chain risk and allowing token-bearing environment variables to be exposed to whatever package version resolves at execution time.

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
90% confidence
Finding

The script executes an external package through npx without any trust prompt, disclosure, or version pinning. In this skill context, that is more dangerous because the tool is explicitly designed to automate ecommerce operations with a live MCP token, so users may run it in production contexts and unknowingly grant a remotely resolved package access to operational credentials.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The error messages shown to users are written only in Chinese, and the script does not provide any opt-in, locale selection, or explanation that it is intended exclusively for Chinese-speaking users. This can violate language/locale policy when a skill imposes a language without user choice or documented justification.

Content

No source excerpt is available for this finding.