Back to skill

Security audit

AI电商专家|电商 AIGC 营销内容

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its ecommerce content-generation purpose, but needs review because it runs a mutable npm package and gives that process the user's full environment.

Install only if you trust the IMIVA npm package publisher and can run it in a constrained environment. Prefer a pinned reviewed package version, avoid running it from shells or CI jobs containing unrelated secrets, and require explicit confirmation before creating tasks that consume credits or upload business media.

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

Unpinned npm Package Is Automatically Downloaded and Executed

Content
View full analysis

Vulnerability Details

File Locations:

  • scripts/imiva_mcp.py:13, 54-63
  • references/mcp-config.example.json:4-8
  • SKILL.md:63, 107-110

Vulnerability Type: Mutable third-party dependency execution and excessive environment inheritance
Risk Level: High

Vulnerable Code

scripts/imiva_mcp.py:13:

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

scripts/imiva_mcp.py:54-63:

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"
],

The same mutable package invocation is recommended in SKILL.md:

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

Technical Analysis

The project invokes npx -y with the dependency specifier @infimind/ecom-content-cli@latest. The latest npm distribution tag is mutable and can resolve to different package contents after this Skill has been reviewed. The -y option suppresses interactive confirmation, allowing the resolved package to be downloaded and executed automatically.

Consequently, the code that runs on the user's machine is not fully represented by the audited project. A compromised npm publisher account, malicious future release, or compromise elsewhere in the package's transitive dependency chain could introduce arbitrary executable behavior.

The helper compounds the potential impact by constructing the subprocess environment with os.environ.copy(). The downloaded package therefore inherits every environment variable available to the Python ...[truncated 2315 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace @infimind/ecom-content-cli@latest with an audited, exact version. Do not use mutable tags or version ranges for executable dependencies.

    python
    PACKAGE = "@infimind/ecom-content-cli@1.2.3"
    
  2. Prefer installing the dependency during a controlled build or deployment phase using a committed lockfile and integrity verification, rather than downloading it dynamically whenever the Skill runs. Use npm ci with a reviewed package-lock.json.

  3. Establish an explicit dependency-upgrade process. Review release differences, regenerate the lockfile, verify package provenance or signatures where available, test in isolation, and approve the new version before deployment.

  4. Pass a minimal allowlisted environment to the subprocess instead of using os.environ.copy(). Include only variables required for runtime operation, along with a constrained PATH if necessary.

    python
    env = {
        "MCP_TOKEN": token,
        "API_URL": os.environ.get(
            "IMIVA_API_URL",
            os.environ.get("API_URL", DEFAULT_API_URL),
        ),
        "PATH": os.environ.get("PATH", ""),
    }
    
  5. Update SKILL.md and references/mcp-config.example.json to use the same pinned and reviewed version.

  6. Run the MCP package in a sandbox or container with restricted filesystem access, no unnecessary credentials, limited outbound network destinations, and a non-privileged operating-system account.

  7. Avoid exposing unrelated secrets to the Skill process. In CI/CD environments, use job-scoped credentials and isolate the MCP invocation from deployment, cloud-administration, and signing credentials.

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

The code copies the entire parent environment into a child process that runs a remote npm package via npx. This can expose unrelated secrets present in the caller environment—such as cloud credentials, CI tokens, proxy auth, or internal configuration—to the spawned package, which is especially risky here because the package is fetched/executed from the npm ecosystem and is versioned as @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
92% confidence
Finding

The skill includes executable shell examples and explicitly relies on environment variables, local file paths, and helper scripts, but it does not declare any explicit tool scope such as permissions or allowed-tools. In practice, this creates an over-broad trust boundary: a hosting agent may expose shell, file read, or environment access beyond what the skill actually needs, increasing the chance of unintended command execution, local file access, or secret exposure if the skill is invoked in a permissive runtime.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The markdown explicitly says the skill is especially suitable for Chinese users, and the metadata sets the language to zh-CN. This can be a language/locale policy issue because the skill appears to prefer a specific language audience without user opt-in or a clearly stated compliance-based justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The display name, description, and default prompt are all written to require use of a Chinese-language e-commerce expert workflow, with no indication that the user can choose another language or locale. This is a natural-language policy concern because the skill appears to impose a specific language experience by default rather than offering an explicit language choice.

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

This Python file contains user-facing error messages in Chinese and a Chinese CLI description, with no indication that the user can choose another language. That can violate a language/locale policy when the skill is expected to be generally usable rather than region-specific.

Content

No source excerpt is available for this finding.