Back to skill

Security audit

AI电商专家|Shopify 独立站 图片视频全内容

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its ecommerce-content purpose, but it should be reviewed because it runs a changing external npm package with the user's MCP token and inherited environment variables.

Install only if you are comfortable running the IMIVA npm MCP package on your machine with an MCP token. Prefer a pinned reviewed package version, avoid running it from a shell containing unrelated secrets, and confirm costs, assets, and task details before any generation call.

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

Error
Location
scripts/imiva_mcp.py:14
Finding

Automatic Execution of an Unpinned npm Package

Content
View full analysis

Vulnerability Details

File Location: scripts/imiva_mcp.py:14, 49-60; additional occurrences in SKILL.md:78, 105-106 and references/mcp-config.example.json:5-6
Vulnerability Type: Supply-chain risk caused by remote retrieval and execution of a mutable dependency
Risk Level: High

Vulnerable Code

python
PACKAGE = "@infimind/ecom-content-cli@latest"
python
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,
)

The bundled example configuration also recommends the same behavior:

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

Technical Analysis

The helper invokes npx with the -y option and the mutable package specifier @infimind/ecom-content-cli@latest. This causes npm to retrieve and execute whichever package version the registry identifies as latest at invocation time, without an interactive installation confirmation.

Consequently, the code actually executed is not contained in or fixed by this audited project. It can change after the project has been reviewed. A compromised package maintainer account, malicious future release, registry compromise, or defective package update could therefore introduce arbitrary behavior into subsequent Skill executions.

The external package inherits a copy of the parent process environment. This explicitly includes MCP_TOKEN and API_URL, as well as any other variables present in os.environ. The package also runs with the operating-system privileges of the user invoking the Skill.

Attack Path

  1. An attacker compromises the npm package publisher, publishing pipe ...[truncated 1592 chars]
Remediation
View remediation

Remediation Suggestions

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

    python
    PACKAGE = "@infimind/ecom-content-cli@1.2.3"
    
  2. Use a lockfile and npm integrity metadata to ensure that installation resolves to the expected artifact. Where operationally possible, install the dependency during a controlled deployment step rather than downloading it every time the Skill runs.

  3. Mirror approved package artifacts in a controlled internal registry and restrict package resolution to that registry.

  4. Establish an explicit upgrade process in which new package versions are reviewed, integrity-checked, tested, and approved before changing the pinned version.

  5. Replace os.environ.copy() with a minimal environment containing only variables required for execution. Avoid exposing unrelated credentials or configuration to the child process.

  6. Run the MCP package under a sandboxed, least-privileged account or container with restricted filesystem and network access.

  7. Update SKILL.md and references/mcp-config.example.json to use the same exact approved version instead of @latest.

  8. Consider disabling automatic npm lifecycle scripts where compatible, and monitor package provenance, signatures, checksums, and publisher changes.

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

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
93% confidence
Finding

Using os.environ.copy() forwards the entire parent environment into the child npx process, not just the intended MCP token and API URL. In combination with running an external package, this can leak unrelated secrets such as cloud credentials, CI tokens, or proxy settings to the child process, making the skill more dangerous because it is explicitly designed to call a networked third-party ecommerce tool.

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

The skill instructs users to run shell commands, read local files via $SKILL_PATH, and configure environment variables containing sensitive tokens, but it does not declare any explicit tool scope such as permissions or allowed-tools. That mismatch increases the chance that an agent or user grants broader access than intended, enabling unintended file access, shell execution, or exposure of secrets during setup and operation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The description states the skill is especially suitable for Chinese users, which imposes a language/locale preference in the skill’s natural-language guidance. The file does not offer a user language choice or explain a necessary compliance-based reason for restricting usage by locale.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill enables allow_implicit_invocation without any trigger constraints, exclusions, or user-confirmation guardrails. That means the agent may invoke this commerce-content skill opportunistically based on loose semantic matching, which can cause unintended use of external content-generation workflows, accidental data sharing, or unreviewed task creation against connected MCP tooling.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script launches an external package and passes credential/configuration data through the environment without explicit disclosure, while using a dynamically resolved package source. In this context, the real danger is not merely lack of warning but that external code executed at runtime can access MCP_TOKEN and API_URL, increasing credential exposure risk if the package is malicious or compromised.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
84% confidence
Finding

The code spawns an external CLI via npx using the floating package specifier '@infimind/ecom-content-cli@latest'. This creates a supply-chain and trust-boundary risk because each execution may fetch or run updated remote code, and that process receives a token-bearing environment, so compromise of the package or its distribution path could expose credentials or execute arbitrary code.

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

The script emits mandatory CLI error messages in Chinese, forcing a specific language on all users. There is no opt-in, fallback, or documentation that this tool is intentionally limited to a Chinese-speaking audience or region-specific deployment.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The script accesses MCP_TOKEN, which is a sensitive credential, but provides no docstring, comment, or user-facing warning explaining that the skill will read and use this secret. The only visible text appears when the variable is missing, which is not the same as proactively disclosing credential use.

Content

No source excerpt is available for this finding.