Back to skill

Security audit

AI电商专家|Etsy 图片视频全内容

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent ecommerce-content purpose, but it runs an unpinned remote npm MCP package with a sensitive token and the full local environment.

Review before installing. Use only in a clean, low-privilege environment with no unrelated secrets in environment variables, prefer a pinned and reviewed version of the npm MCP package, and confirm expected credit spend before creating generation tasks. No evidence of intentional theft or persistence was found, but the current packaging is broader than it needs to be.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
Findings (2)

T08 · Insecure Dependencies

Warning
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, 44-52; also documented in SKILL.md:113-126 and references/mcp-config.example.json:4-8
Vulnerability Type: Supply-chain risk caused by mutable dependency resolution and automatic execution
Risk Level: Medium

Complete Code Snippet:

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,

Corresponding example configuration:

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 helper invokes npx with the -y option and the mutable package identifier @infimind/ecom-content-cli@latest. The latest distribution tag can resolve to different package contents over time, so the code executed during a future invocation is not necessarily the code that was available when this Skill was audited.

The -y option suppresses the package-installation confirmation. Consequently, listing tools or calling an MCP operation may download and execute a newly published package without requiring the user to inspect or explicitly approve that particular release.

This behavior establishes a remote code retrieval and execution channel through the npm registry. A compromised publisher account, malicious future package release, registry compromise, or compromised transitive dependency could cause attacker-control ...[truncated 1701 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace the mutable package reference with an audited exact version, for example:

    python
    PACKAGE = "@infimind/ecom-content-cli@1.2.3"
    
  2. Do not rely on npx -y to download executable code at every invocation. Install the dependency through a controlled deployment process and invoke the locally installed, verified binary.

  3. Use a lockfile and integrity hashes to ensure reproducible dependency resolution, including transitive dependencies.

  4. Verify npm package provenance, publisher identity, signatures, and release history before approving upgrades.

  5. Introduce a deliberate update process that includes source review, vulnerability scanning, and testing before changing the pinned version.

  6. Where supported, use a trusted internal registry or package mirror that only contains approved package versions.

  7. Run the MCP package in a sandbox or container with restricted filesystem and network access.

  8. Update SKILL.md and references/mcp-config.example.json to use the same pinned, approved version.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/imiva_mcp.py:44
Finding

Third-Party MCP Process Inherits the Entire Parent Environment

Content
View full analysis

Vulnerability Details

File Location: scripts/imiva_mcp.py:44-58
Vulnerability Type: Excessive credential exposure to a third-party subprocess
Risk Level: Medium

Complete Code Snippet:

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

Technical Analysis

os.environ.copy() duplicates every environment variable from the Python process. The complete environment is then supplied to the externally maintained npm package through subprocess.Popen(..., env=env).

The MCP process legitimately requires selected values such as MCP_TOKEN, API_URL, and a limited set of runtime variables. It does not require unrestricted access to every variable present in the calling shell. Developer and automation environments frequently contain unrelated secrets such as cloud credentials, source-control tokens, database passwords, signing credentials, CI/CD tokens, proxy credentials, and other API keys.

This violates least-privilege principles by exposing unrelated credentials to third-party executable code. The risk is amplified because the subprocess package is fetched using the mutable latest tag. No explicit secret exfiltration logic was found in the audited project, so this finding represents unnecessary credential exposure rather than confirmed theft.

Attack Path

  1. A user or automation process starts the helper from an environment containing unrelated sensitive variables.
  2. invoke() copies the entire process environment with os.environ.copy().
  3. The helper s ...[truncated 1310 chars]
Remediation
View remediation

Remediation Suggestions

  1. Replace the complete environment copy with an explicit allowlist containing only variables required to launch Node.js and communicate with IMIVA.

  2. Construct a minimal environment, 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),
        ),
    }
    
  3. Add only platform-specific runtime variables proven necessary, such as SYSTEMROOT on Windows or an intentionally selected certificate-store variable.

  4. Do not forward cloud credentials, repository tokens, database secrets, SSH-related variables, or unrelated API keys.

  5. Run the subprocess under a dedicated low-privilege account or inside a sandbox with restricted filesystem and network access.

  6. Scope and rotate the IMIVA token regularly. Use a token limited to only the MCP operations required by the Skill.

  7. Add automated tests that populate the parent environment with sentinel secrets and verify that the child process cannot observe them.

  8. Combine environment minimization with exact package pinning and integrity verification to reduce the likelihood and impact of a dependency compromise.

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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (6)

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
88% confidence
Finding

Using os.environ.copy() forwards the full parent environment into a subprocess that executes remotely sourced npm code. That unnecessarily exposes all ambient secrets and configuration values in the caller's environment to child-process code, greatly increasing blast radius if the package is malicious or 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
91% confidence
Finding

The skill instructs the user to run shell commands, read local files via $SKILL_PATH, and configure environment variables containing a sensitive MCP token, but it does not declare any explicit tool scope or allowed-tools boundary. This creates an avoidable trust gap: an agent or reviewer cannot tell from the manifest what capabilities are intended, increasing the risk of overbroad execution or secret exposure if the skill is invoked in a permissive client.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
92% confidence
Finding

The code launches npx -y @infimind/ecom-content-cli@latest, which fetches and executes the latest remote npm package at runtime. This creates a real supply-chain and arbitrary-code-execution risk because any compromise of the package, its dependencies, or the publisher account would run code locally with the user's environment and token access.

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

The script invokes a remote npm package non-interactively via npx -y, suppressing any user confirmation while downloading and executing code from the network. In a security-sensitive skill that handles API tokens and content-generation workflows, silent remote execution increases the chance of users unknowingly running unreviewed code.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest sets language: zh-CN, and the skill content repeatedly frames the tool for Chinese users without indicating that other languages are supported or that the user may choose their preferred language. This can violate language/locale policy where skills should not force a locale without user opt-in or explicit justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The runtime error messages are hard-coded in Chinese, and the CLI description/help text also uses Chinese without any indication that language selection is configurable. This can violate language/locale policy when a skill forces a specific language without user opt-in.

Content

No source excerpt is available for this finding.