Back to skill

Security audit

AI电商专家|AliExpress 速卖通 图片视频全内容

Security checks for vulnerabilities and agentic risk

Overview

The skill matches an ecommerce content-generation purpose, but it automatically runs an unpinned external MCP package with broad environment access and implicit activation enabled.

Install only if you trust the IMIVA service and npm package supply chain. Prefer pinning a reviewed package version, disabling implicit invocation, running it in an isolated environment with only the needed `MCP_TOKEN` and `API_URL`, and confirming credits, assets, and task creation before sending product data or local files.

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 Package

Content
View full analysis

Vulnerability Details

File Locations:

  • scripts/imiva_mcp.py:13
  • scripts/imiva_mcp.py:50-59
  • references/mcp-config.example.json:4-8
  • SKILL.md:111-116

Vulnerability Type: Unpinned third-party dependency with automatic download and execution
Risk Level: Medium

Vulnerable Code

scripts/imiva_mcp.py:13:

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

scripts/imiva_mcp.py:50-59:

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-8:

json
"command": "npx",
"args": [
  "-y",
  "@infimind/ecom-content-cli@latest"
],

SKILL.md:111-116:

json
"command": "npx",
"args": [
  "-y",
  "@infimind/ecom-content-cli@latest"
],

Technical Analysis

The Skill invokes @infimind/ecom-content-cli@latest through npx -y. The latest npm tag is mutable and may resolve to a different package release each time the Skill is used. The -y option automatically approves package installation, allowing the resolved package to be downloaded and executed without an interactive review.

The project does not provide an exact package version, lockfile, package integrity hash, or vendored and reviewed implementation. Therefore, the code that executes at runtime is not necessarily the code that existed when this Skill was audited.

The Python helper also constructs the child-process environment using os.environ.copy(). As a result, the downloaded package receives the complete inherited environment, including MCP_TOKEN and potentially unrelated credentials or sensitive configuration present in the parent process.

...[truncated 2002 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace @infimind/ecom-content-cli@latest with a reviewed, exact 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. Do not download dependencies automatically during normal Skill execution. Install the reviewed package through a separate, explicit setup process and invoke the installed binary afterward.

  3. Use a lockfile and npm integrity metadata. Commit the lockfile to the repository and perform installations with a reproducible command such as npm ci.

  4. Verify package provenance and integrity before execution. Where supported, require registry signatures, trusted publisher metadata, or an expected package archive hash.

  5. Replace os.environ.copy() with a minimal environment containing only the variables required by the MCP process. 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 MCP package with least privilege in an isolated environment or container. Restrict filesystem access, outbound network destinations, and access to unrelated user credentials.

  7. Establish a controlled update process in which new package versions are reviewed, tested, and explicitly pinned before deployment.

  8. Rotate MCP_TOKEN and audit service activity if an untrusted or unexpected package version may already have been executed.

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 (10)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill is presented as a narrowly scoped AliExpress ecommerce-content generator, but the included workflow and helper commands expose a more general MCP client pattern, including tool discovery and effectively arbitrary MCP invocation. This mismatch is dangerous because users and policy systems may grant trust based on the declared purpose while the actual behavior can reach broader backend capabilities than expected.

Content

No source excerpt is available for this finding.

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
81% confidence
Finding

The script clones the entire parent environment with os.environ.copy() and passes it to an external npm package executed via npx. In this skill context, that means all ambient secrets present in the runtime environment—not just MCP_TOKEN—become available to third-party Node code fetched/executed outside this Python file, expanding the 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
92% confidence
Finding

The skill exposes capabilities consistent with environment access, file reads, and shell execution but does not declare an explicit tool scope such as permissions or allowed-tools. In a skill that handles tokens and local file paths, this creates unnecessary privilege ambiguity and raises the risk of unintended access to secrets, local files, or command execution beyond the stated ecommerce workflow.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The invocation description is broad enough that an agent could activate this skill in many loosely related ecommerce or content scenarios without clear user intent. Over-broad trigger conditions increase the chance of unnecessary tool use, billing actions, processing of local/remote media, or exposure of enterprise tokens in contexts where the user did not explicitly request this skill.

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 with no visible trigger constraints, exclusions, or user-confirmation safeguards. In a skill that can generate ecommerce images, videos, and listing content and invoke real MCP tools, this increases the chance the agent will auto-select and execute the skill in unrelated contexts, potentially sending product assets, URLs, or business data to external tooling 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
94% confidence
Finding

The script's error messages are hard-coded in Chinese, which imposes a specific language on users without opt-in or any documented locale justification. This is a natural-language policy concern because the skill does not offer a language choice or explain that it is intended only for a Chinese-speaking audience.

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

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The metadata sets language: zh-CN, which can indicate a fixed language/locale preference. The file does not clearly offer users a language choice or explain that the locale restriction is required for a justified region-specific purpose.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The code reads the sensitive MCP_TOKEN environment variable and passes it into the child process environment, but there is no user-facing log, comment, or other disclosure in this file explaining that credentials are being consumed and forwarded. For code files, sensitive environment-variable access should have some visible warning unless clearly disclosed elsewhere.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The script launches an external process via npx using the latest version of a package, which is a safety-relevant operation because it executes code outside the Python process. Although this aligns with the tool's purpose, this file does not include any explicit warning, log, or comment that it will invoke an external MCP package.

Content

No source excerpt is available for this finding.