Back to skill

Security audit

AI电商专家|美妆护肤电商图片视频

Security checks for vulnerabilities and agentic risk

Overview

The skill’s ecommerce purpose is clear, but it runs a mutable npm package with broad inherited environment access, so users should review it before installing.

Install only if you trust the IMIVA npm package and are comfortable running it locally. Prefer a pinned reviewed package version, run it in a clean shell or container with only MCP_TOKEN, API_URL, PATH, and required runtime variables, and confirm any credit-consuming task before submission.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T03 · Remote Payload Retrieval and Execution

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,54-61; references/mcp-config.example.json:4-8; SKILL.md:88-92
Vulnerability Type: Mutable remote dependency retrieval and execution
Risk Level: High

Vulnerable Code

scripts/imiva_mcp.py:14:

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

scripts/imiva_mcp.py:54-61:

python
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:88-92:

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

Technical Analysis

The helper invokes npx with both -y and the mutable @latest package tag. This causes npm to retrieve and execute whichever package release is designated as latest at invocation time, without interactive confirmation.

The effective executable payload can therefore change after this Skill has been reviewed. The repository does not pin an audited package version, provide a lockfile for the executed package, or verify the downloaded artifact against an expected integrity hash. Consequently, the audit of the local files cannot establish what third-party code future executions will run.

This is both an insecure dependency-management practice and a remote payload execution channel. Exploitation would require compromise or malicious modification of the npm package, its publisher account, or the relevant package-distribution path; no evidence was found that the package is currently malicious.

Attack Path

  1. An attacker compromises the npm publisher account, package, or release process for @infimind/ecom-content-cli.
  2. The attacker publishes a malicious ...[truncated 1117 chars]
Remediation
View remediation

Remediation Suggestions

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

    python
    PACKAGE = "@infimind/ecom-content-cli@1.2.3"
    
  2. Remove automatic ad hoc package retrieval from normal Skill execution. Install the dependency during a controlled deployment or setup phase and invoke the installed executable directly.

  3. Commit and enforce an npm lockfile containing package integrity metadata.

  4. Verify the package artifact against an expected registry integrity hash or independently maintained checksum before execution.

  5. Review package updates before changing the pinned version. Use automated dependency scanning and provenance verification where supported.

  6. Apply the same exact version in scripts/imiva_mcp.py, SKILL.md, and references/mcp-config.example.json so users are not directed back to the mutable tag.

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

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/imiva_mcp.py:51
Finding

Third-Party MCP Process Inherits the Complete Parent Environment

Content
View full analysis

Vulnerability Details

File Location: scripts/imiva_mcp.py:51-60
Vulnerability Type: Excessive environment-variable disclosure to a third-party process
Risk Level: Medium

Vulnerable Code

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

Technical Analysis

os.environ.copy() duplicates the entire environment of the calling process and supplies it to the npm-hosted MCP process. The MCP implementation needs selected runtime settings, the IMIVA token, and the API endpoint, but it is also given every unrelated environment variable held by the parent.

Agent, CI, developer, and cloud environments frequently contain repository tokens, cloud credentials, signing credentials, database connection strings, proxy credentials, and API keys. A child process can read all inherited environment variables without exploiting an operating-system vulnerability.

This violates least privilege and substantially increases the impact of the unpinned dependency issue. There is no direct credential-exfiltration implementation in the audited Python code; exploitation depends on the child package being malicious or compromised.

Attack Path

  1. The user launches the Skill from an environment containing credentials unrelated to IMIVA.
  2. The helper copies the entire parent environment using os.environ.copy().
  3. The helper launches the remotely sourced npm MCP package with that copied environment.
  4. A compromised or malicious package enumerates its process environment.
  5. It reads unrelated tokens or connection credentials.
  6. Through its permitted network access, it can disclose or misuse those credentials against the ...[truncated 658 chars]
Remediation
View remediation

Remediation Suggestions

  1. Replace os.environ.copy() with a minimal environment allowlist.

  2. Include only variables required to locate and execute the runtime, along with the explicit IMIVA settings. 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 demonstrably required platform variables, such as a temporary-directory or certificate-store location, after testing on supported operating systems.

  4. Do not forward cloud, repository, database, CI, or unrelated application credentials.

  5. Execute the MCP server under a dedicated low-privilege account or isolated container with a sanitized environment.

  6. Restrict outbound network access to approved IMIVA and package-distribution endpoints where operationally feasible.

  7. Add a regression test that launches a test child process and verifies that a sentinel secret in the parent environment is not inherited.

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

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
94% confidence
Finding

os.environ.copy() forwards the full parent environment to the child process, potentially exposing unrelated secrets such as cloud credentials, API keys, proxy settings, or CI tokens. In this skill, that risk is amplified because the child is an npm package fetched at runtime, so a compromise upstream could harvest far more than the intended MCP_TOKEN.

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

The skill references shell execution, environment-variable handling, and file access patterns but does not declare any explicit tool scope such as permissions or allowed-tools. That weakens least-privilege boundaries and can cause a host agent to expose broader capabilities than users expect, especially because the instructions include command execution examples and local file path handling.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest explicitly sets language: zh-CN, and the document repeatedly targets Chinese users without indicating that other languages are optional or user-selectable. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation unless the restriction is clearly documented and justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The display name, short description, and default prompt all force a specific language/locale in natural-language content. Because there is no user opt-in or justification that this is a China-only or Chinese-only skill, this may violate language or locale policy requirements.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill enables implicit invocation with no visible trigger constraints, exclusions, or scope limits. In a commerce workflow, this can cause the agent to auto-route user requests into a capability that may initiate content-production actions or collect business inputs without sufficiently explicit user intent, increasing the chance of unintended tool use, data exposure, or prompt-surface abuse.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script passes MCP_TOKEN to a child process environment, giving downloaded npm code access to a sensitive credential. Because the child process is the remotely resolved package, token exposure is especially risky here: compromised package code could exfiltrate the token and use it to access IMIVA services or customer data.

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,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script executes npx -y @infimind/ecom-content-cli@latest, which can fetch and run a remote npm package at runtime without an explicit warning or consent step. Using @latest makes behavior mutable over time; if the package is compromised or updated maliciously, users will execute attacker-controlled code locally.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The error messages shown to users are written only in Chinese, and the script does not offer any language selection or indicate that it is intentionally region-specific. 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.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The argparse description and help strings are presented only in Chinese, which forces a specific language for user interaction. There is no opt-in, locale selection, or documentation in this file indicating that the tool is intentionally limited to Chinese-speaking users.

Content

No source excerpt is available for this finding.