Back to skill

Security audit

AI电商专家|电商商品详情页

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent ecommerce purpose, but it should be reviewed because it runs an unpinned npm MCP package with user credentials and inherited environment access.

Install only if you trust the IMIVA npm MCP package and are comfortable giving it an MCP token that may create chargeable tasks. Prefer a pinned reviewed package version, run it in a clean environment with no unrelated secrets, avoid setting API_URL or IMIVA_API_URL to untrusted hosts, and rotate the token if you suspect exposure.

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

Error
Location
scripts/imiva_mcp.py:14
Finding

Mutable npm Package Is Automatically Downloaded and Executed with Sensitive Credentials

Content
View full analysis

Vulnerability Details

File Location: scripts/imiva_mcp.py:14, 50-58; related configuration at SKILL.md:46, 85-89 and references/mcp-config.example.json:4-8
Vulnerability Type: Unpinned third-party dependency and unattended remote package execution
Risk Level: High

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 package selection is recommended in the MCP example:

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 -y and the mutable npm version specifier @latest. This causes npm to resolve and potentially download whatever package version is associated with the latest distribution tag at execution time. The effective executable can therefore change after this Skill has been reviewed.

No exact version, lockfile, package integrity hash, signature verification, or locally reviewed installation is used. The downloaded package executes under the user's account and receives MCP_TOKEN along with the process's inherited environment. This creates a supply-chain trust boundary in which a compromised publisher account, malicious future release, or compro ...[truncated 1451 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace @latest with an exact, reviewed package version, such as @infimind/ecom-content-cli@X.Y.Z.
  2. Install the dependency through a committed lockfile that records package integrity hashes.
  3. Remove -y so that unexpected installation or resolution behavior is not accepted automatically.
  4. Prefer invoking a preinstalled, locally verified executable rather than downloading code during every Skill run.
  5. Verify package provenance and signatures where the package ecosystem supports them.
  6. Establish an explicit dependency-upgrade process that includes source review, integrity verification, and security testing before changing the pinned version.
  7. Run the MCP package in a sandbox with restricted filesystem and network access.
  8. Pass only the environment variables strictly required by the MCP package rather than inheriting the complete parent environment.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/imiva_mcp.py:50
Finding

Environment-Controlled API Endpoint Can Redirect Credential-Bearing MCP Traffic

Content
View full analysis

Vulnerability Details

File Location: scripts/imiva_mcp.py:50-58
Vulnerability Type: Unvalidated security-sensitive endpoint configuration and excessive environment inheritance
Risk Level: Medium

Vulnerable Code

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

The helper obtains the destination API endpoint from IMIVA_API_URL or the generic API_URL environment variable and forwards it to the MCP child process. It does not validate the URL scheme, hostname, port, or destination against the documented IMIVA service.

The same child process receives MCP_TOKEN. Consequently, a poisoned shell, CI environment, wrapper script, or agent runtime can configure an attacker-controlled endpoint before the helper starts. The external MCP package is then given both the credential and the untrusted destination configuration.

The use of os.environ.copy() also exposes all inherited environment variables to the third-party child process, even though the declared operation only requires a limited set of variables. This violates least-privilege principles and increases the consequences of dependency compromise.

Attack Path

  1. An attacker gains the ability to influence the environment used to launch the Skill, such as a shell profile, CI variable, wrapper process, or agent configuration.
  2. The attacker sets IMIVA_API_URL or API_URL to an endpoint under attacker control.
  3. The user invokes scripts/imiva_mcp.py.
  4. The helper copies the p ...[truncated 995 chars]
Remediation
View remediation

Remediation Suggestions

  1. Default to the fixed endpoint https://imiva.ecpro.com and reject unexpected destinations.
  2. Parse the configured URL and require HTTPS, the expected hostname, and an approved port.
  3. If custom endpoints are required for development, require an explicit command-line opt-in and display a clear warning before forwarding credentials.
  4. Do not use the generic API_URL variable as an implicit fallback because it can collide with unrelated application configuration.
  5. Construct a minimal child environment containing only required runtime variables, such as PATH, MCP_TOKEN, and the validated endpoint.
  6. Avoid forwarding unrelated secrets from the parent process.
  7. Add automated tests confirming that HTTP URLs, malformed URLs, embedded credentials, alternate hosts, and unexpected ports are rejected.
  8. Document token rotation and revocation procedures in case endpoint redirection or token disclosure is suspected.
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 (7)

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
95% confidence
Finding

The code clones the full parent environment and passes it to an external process started via npx, which means unrelated secrets present in the host environment may be exposed to the spawned Node package. This is more concerning here because the package is fetched as @latest from the npm ecosystem, increasing supply-chain risk if the package or one of its dependencies is compromised and reads inherited credentials.

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

The skill includes shell execution, environment-variable usage, and file-path handling examples, but it does not declare any explicit tool scope or allowed-tools boundary. That increases the risk of over-privileged execution in hosts that infer capabilities from content, making unintended shell access, local file access, or secret exposure more likely if the skill is invoked in a broader context.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The description says 'Use this skill for IMIVA ecommerce content, product images, product detail pages, KOC seeding, product video, viral creative recreation, marketplace listing and social commerce workflows.' This is a very broad activation scope spanning many common ecommerce activities, without clear boundaries or exclusion conditions, which increases the chance of unintended invocation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file sets language: zh-CN in metadata and the usage examples hardcode "language":"简体中文", while the document does not offer an opt-in or alternative locale choice. This can violate language/locale policy when users may want output in other languages.

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

The skill states it is especially suitable for '中文用户', which imposes a locale preference in natural-language guidance. The document does not clearly state that this is optional or explain a strict regional compliance reason for excluding other locales.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This Python file includes user-facing error messages only in Chinese for missing runtime and token conditions. Under the natural-language policy rule, forcing a specific language without user opt-in is a locale/language policy violation unless the skill is explicitly documented as region-specific, which is not evident in this file.

Content

No source excerpt is available for this finding.