Back to skill

Security audit

AI电商专家|竞品构图参考重制

Security checks for vulnerabilities and agentic risk

Overview

The skill's ecommerce workflow is coherent, but it runs an unpinned external npm MCP client with credentials and exposes a broad tool-call wrapper that deserves manual review before installation.

Review this before installing in an environment with valuable secrets. Use a dedicated shell or sandbox with only the IMIVA token and required PATH variables, prefer a pinned audited version of the npm package, and avoid giving the token permissions or credits beyond what you are prepared to spend.

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:14
Finding

Unpinned npm Package Is Downloaded and Executed at Runtime

Content
View full analysis

Vulnerability Details

File Location: scripts/imiva_mcp.py, lines 14 and 50–64
Vulnerability Type: Supply-chain risk caused by mutable dependency resolution and automatic remote execution
Risk Level: Medium

Vulnerable Code

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

The same unsafe invocation is prescribed in SKILL.md, lines 85–89, and references/mcp-config.example.json, lines 4–8:

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

Technical Analysis

The helper invokes npx with -y and the mutable npm tag @latest. Consequently, the package code executed by the Skill is not fixed to the version that was available during this audit. On a system where the package is absent or outdated, npx can retrieve the package selected by the current latest tag and execute its entry point without interactive confirmation.

This creates a time-of-review versus time-of-use supply-chain gap. A future package release, compromised publisher account, or compromised transitive dependency could change the effective executable payload without any modification to this repository.

The subprocess receives a copy of the parent process environment and is explicitly provided with MCP_TOKEN. A malicious package would execute with the operating-system privileges of the user running the Skill and could read that token and other inherited environment variables.

No evidence was found that the currently reviewed pr ...[truncated 1476 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace the mutable @latest tag with a specific, audited package version, for example:

    python
    PACKAGE = "@infimind/ecom-content-cli@1.2.3"
    
  2. Update SKILL.md and references/mcp-config.example.json to use the same pinned version so documented execution paths do not bypass the fix.

  3. Install dependencies through a committed lockfile with integrity hashes rather than downloading an unresolved package during every invocation.

  4. Introduce a controlled dependency-upgrade process that includes source review, integrity verification, vulnerability scanning, and testing before changing the pinned version.

  5. Avoid passing the complete parent environment to third-party code. Construct a minimal environment containing only required runtime variables. Treat MCP_TOKEN as an exposed secret whenever the external client executes and support prompt token revocation and rotation.

  6. Run the external MCP client in a restricted environment where practical, limiting filesystem access, network destinations, process creation, and operating-system privileges.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (7)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill is presented as a narrowly scoped ecommerce visual-migration skill, but its documented behavior includes generic MCP client operations such as tool enumeration and arbitrary tool invocation through a wrapper script. That mismatch is dangerous because users and platforms may grant trust based on the declared narrow purpose while the skill can be repurposed to access additional MCP capabilities, potentially triggering unintended actions, data access, or billing.

Content

No source excerpt is available for this finding.

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
90% confidence
Finding

Using os.environ.copy() forwards the entire parent environment into the spawned process, not just the intended MCP values. That can leak unrelated secrets such as cloud credentials, CI tokens, proxies, and service keys to the external npx package, greatly expanding blast radius if the child process is malicious, logs its environment, or is later 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
84% confidence
Finding

The skill exposes shell, file-read, and environment-variable usage patterns but does not declare any tool scope or allowed-tools boundaries. In practice, this weakens least-privilege controls and makes it harder for a host or reviewer to distinguish the intended MCP workflow from broader local-capability use, increasing the chance of unintended file, shell, or secret access.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill explicitly states it is particularly suitable for Chinese users, and the metadata also fixes the language to zh-CN, but the document does not offer users a language choice or explain that this locale restriction is required. This can violate the language/locale policy criterion for natural-language content.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
88% confidence
Finding

The code spawns an external package via npx -y @infimind/ecom-content-cli@latest, which fetches and executes code at runtime without pinning a version or verifying integrity. In this same call path it supplies sensitive environment values to that child process, so a compromised package, typosquat, or upstream account compromise could immediately access credentials and perform arbitrary actions.

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

This wrapper transparently forwards MCP_TOKEN and API_URL into a third-party CLI process with no warning, confirmation, or trust boundary explanation to the operator. Because the package is executed dynamically through npx, users may not realize their credential is being handed to remotely sourced code, increasing the risk of credential theft or unauthorized API use if the dependency is malicious or compromised.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

Several user-visible error messages and help strings are written only in Chinese, such as the runtime and token errors and the argparse description/help text. This forces a specific language choice on all users without offering a locale option or documenting that the tool is intentionally Chinese-only for a justified regional scope.

Content

No source excerpt is available for this finding.