Back to skill

Security audit

AI电商专家|电商信息图套装

Security checks for vulnerabilities and agentic risk

Overview

This skill is mostly aligned with IMIVA ecommerce content generation, but it runs a mutable npm MCP package with credentials and exposes broader tool-calling authority than its advertised infographic workflow needs.

Review before installing. Use a dedicated, revocable IMIVA token with minimal permissions, avoid running it in an environment containing unrelated secrets, and prefer a pinned reviewed package version or a restricted MCP configuration. Confirm before submitting paid generation tasks or sending local product assets to the service.

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

Unpinned npm Package Is Automatically Downloaded and Executed with a Sensitive Token

Content
View full analysis

Vulnerability Details

File Locations:

  • scripts/imiva_mcp.py:13
  • scripts/imiva_mcp.py:47-60
  • references/mcp-config.example.json:3-11
  • SKILL.md:103-114

Vulnerability Type: Supply-chain risk caused by automatic execution of an unpinned third-party dependency
Risk Level: Medium

Vulnerable Code

scripts/imiva_mcp.py:13:

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

scripts/imiva_mcp.py:47-60:

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

references/mcp-config.example.json:3-11:

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

SKILL.md:103-114:

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 project invokes npx with the -y option and the mutable package specifier @infimind/ecom-content-cli@latest. This causes npm to resolve and, when necessary, download and execute whichever package version is associated with the latest distribution tag at execution time.

Because no exact package version, lockfile, or integrity digest is enforc ...[truncated 2547 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace the latest tag with an exact, reviewed package version, for example:

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

    Apply the same exact version in SKILL.md and references/mcp-config.example.json.

  2. Install dependencies through a committed lockfile and use a deterministic installation mechanism such as npm ci. Preserve and verify npm integrity metadata.

  3. Establish a controlled dependency-upgrade process that includes release review, security scanning, changelog inspection, and testing before changing the pinned version.

  4. Avoid noninteractive installation and execution with npx -y in security-sensitive workflows. Prefer a previously installed and verified local executable.

  5. Replace os.environ.copy() with an allowlisted environment containing only values required by the MCP package. For example:

    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),
        ),
    }
    
  6. Run the dependency in a restricted environment with minimal filesystem permissions, limited network access, and a dedicated low-privilege account where practical.

  7. Use a narrowly scoped and revocable MCP token. Monitor account activity and rotate the token if dependency compromise is suspected.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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
Findings (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The documented purpose is a narrow ecommerce infographic/detail-page workflow, but the included helper commands support generic tools listing and arbitrary MCP tool invocation. That mismatch is dangerous because users may trust the skill as single-purpose while it effectively operates as a broader MCP client capable of discovering and calling unintended backend functionality.

Content

No source excerpt is available for this finding.

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
90% confidence
Finding

os.environ.copy() forwards the entire parent environment into the spawned npx process, not just the required token and API URL. If the child package is compromised, over-privileged, or simply logs environment data, unrelated secrets and internal configuration from the host environment may be exposed to external code; this is more concerning here because the package is fetched via npx and pinned to @latest.

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

The skill exposes shell, file-read, and environment-dependent execution paths but does not declare any explicit tool scope or allowed-tools boundary. In practice, this weakens least-privilege controls and makes it easier for the skill to access local files, environment secrets, or execute commands beyond what users would expect from an ecommerce infographic generator.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The phrase "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" casts a very wide activation net across common ecommerce activities without clear boundaries or exclusion conditions. In a markdown skill file, this can cause unintended invocation because it does not specify when this skill should be preferred versus more specialized skills.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The description says the skill is especially suitable for Chinese users, and the example task payload later hard-codes "language":"简体中文". This is a natural-language locale policy issue because the skill appears to impose a specific language by default without offering an opt-in choice or clearly stating that the skill is region-specific only.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill enables implicit invocation for a capability that can trigger real MCP-backed ecommerce content generation workflows, but it defines no trigger boundaries, exclusions, or consent checks. This increases the chance the agent will auto-select the skill in loosely related conversations and send product assets, business requirements, or task requests to downstream tools without sufficiently explicit user intent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script's user-visible error messages are written only in Chinese, which imposes a language choice on all users. There is no opt-in, fallback, or documented justification showing that this skill is intentionally limited to a Chinese-speaking audience.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script reads MCP_TOKEN from the environment and injects it into the child process environment for the npx-launched MCP client. Although this is functionally necessary, the code provides no user-facing warning, logging, or comment disclosing that a credential will be consumed and shared with a subprocess.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

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,

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The argparse description and help strings are presented only in Chinese, forcing a single language for CLI interaction. Under the stated policy, a language constraint should be optional or clearly justified rather than imposed implicitly.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The wrapper exposes a generic call command that forwards any tool name and arbitrary JSON arguments to tools/call, allowing use of any MCP capability available to the token rather than limiting execution to the advertised infographic/detail-page workflow. In a skill context, this expands the effective permission scope and can enable unintended actions, data access, or misuse of privileged tools if the token has broader entitlements.

Content

No source excerpt is available for this finding.