Back to skill

Security audit

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

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent ecommerce content-generation purpose, but it should be reviewed because it auto-runs a mutable npm MCP package while passing it the full local environment and token-bearing configuration.

Install only if you are comfortable running the IMIVA npm MCP package from npm at invocation time. Prefer pinning a reviewed package version, running it in a restricted environment, using a dedicated low-scope MCP token, clearing unrelated secrets from the shell environment, and verifying the API endpoint before submitting billable generation tasks.

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

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, 49-60; also referenced in SKILL.md:46, 86-91 and references/mcp-config.example.json:4-8
Vulnerability Type: Unpinned third-party executable dependency
Risk Level: Medium

Complete Code Snippet

python
PACKAGE = "@infimind/ecom-content-cli@latest"
DEFAULT_API_URL = "https://imiva.ecpro.com"
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 example configuration independently recommends the same behavior:

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 wrapper invokes npx -y @infimind/ecom-content-cli@latest. The latest tag is mutable, so the code executed during a future invocation may differ from the version available at audit time. The -y option removes the interactive installation confirmation.

Consequently, the effective executable is neither pinned nor contained in the reviewed project. A compromised npm publisher account, package registry compromise, or malicious future package release could introduce arbitrary code without requiring any change to this repository.

This issue is classified as an insecure dependency because execution depends on a mutable package release obtained fr ...[truncated 1426 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace the mutable @latest reference with an exact, reviewed package version, such as @infimind/ecom-content-cli@x.y.z.
  2. Use a lockfile that records the complete transitive dependency graph and package integrity hashes.
  3. Install dependencies during a controlled setup phase rather than downloading executable code whenever the Skill is invoked.
  4. Run automated vulnerability and provenance checks against the pinned package and all transitive dependencies.
  5. Where possible, verify npm package signatures, registry provenance attestations, and expected integrity hashes.
  6. Consider vendoring the reviewed client or using a locally installed, integrity-verified executable.
  7. Execute the MCP process in a sandbox with restricted filesystem and network access.
  8. Update SKILL.md and references/mcp-config.example.json so they do not instruct users to run the mutable latest release.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/imiva_mcp.py:49
Finding

Complete Parent Environment Exposed to an External MCP Process

Content
View full analysis

Vulnerability Details

File Location: scripts/imiva_mcp.py:49-60
Vulnerability Type: Excessive environment-variable inheritance and secret exposure
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() copies every environment variable from the parent process. The resulting environment is then supplied to a third-party npm package through subprocess.Popen.

The external MCP process only appears to require a limited set of values, principally MCP_TOKEN, API_URL, the executable search path, and possibly locale or runtime configuration. Forwarding the complete environment violates least-exposure principles and may disclose unrelated credentials to code outside the audited repository.

Potentially exposed values include cloud access keys, CI/CD tokens, source-control credentials, proxy credentials, database connection strings, and unrelated API keys. This risk is amplified by the use of an automatically downloaded, unpinned dependency.

Attack Path

  1. The parent process is launched in an environment containing unrelated sensitive variables.
  2. The user invokes the Skill wrapper.
  3. os.environ.copy() duplicates all parent environment variables.
  4. The complete environment is supplied to the external npm process.
  5. A malicious or compromised package enumerates the inherited variables.
  6. The package uses the credentials locally or transmits them through an available netw ...[truncated 742 chars]
Remediation
View remediation

Remediation Suggestions

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

  2. Pass only variables demonstrably required by the MCP runtime, for example:

    python
    env = {
        "PATH": os.environ.get("PATH", ""),
        "MCP_TOKEN": token,
        "API_URL": validated_api_url,
        "LANG": os.environ.get("LANG", "C.UTF-8"),
    }
    
  3. Add runtime-specific variables only after confirming that Node.js or npx requires them.

  4. Never forward cloud credentials, repository tokens, database secrets, or unrelated API keys by default.

  5. Run the child process under a dedicated low-privilege account or sandbox.

  6. Restrict outbound network access to the approved package registry during installation and the approved IMIVA API origin during operation.

  7. Add automated tests that populate the parent environment with sentinel secrets and verify that they are absent from the child environment.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/imiva_mcp.py:49
Finding

Unvalidated API Endpoint Override Can Redirect Token-Bearing Requests

Content
View full analysis

Vulnerability Details

File Location: scripts/imiva_mcp.py:49-53
Vulnerability Type: Unvalidated security-sensitive endpoint configuration
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))

The default endpoint is defined as:

python
DEFAULT_API_URL = "https://imiva.ecpro.com"

The documentation also supports overriding the endpoint:

bash
export MCP_TOKEN='在本机填写完整Token'
export IMIVA_API_URL='https://imiva.ecpro.com'

Technical Analysis

The wrapper allows either IMIVA_API_URL or the generic API_URL environment variable to replace the default API destination. It does not parse the selected URL, require HTTPS, validate the hostname, or obtain explicit confirmation before pairing the endpoint with MCP_TOKEN.

The generic API_URL fallback is particularly risky because it may already be set for an unrelated application in a shared shell, CI job, or agent runtime. The wrapper passes both the selected endpoint and the token to the external MCP process.

Whether the token is transmitted in a request is ultimately determined by the third-party MCP package, which is outside the reviewed source. Nevertheless, the wrapper creates the conditions for authenticated requests or sensitive task data to be redirected to an unintended origin.

Attack Path

  1. An attacker gains control over the launch environment, a shell profile, CI configuration, agent configuration, or another mechanism capable of setting environment variables.
  2. The attacker sets IMIVA_API_URL or API_URL to an attacker-controlled endpoint.
  3. The user invokes the Skill without noticing the modified environment.
  4. The wrapper accepts the endpoint w ...[truncated 1051 chars]
Remediation
View remediation

Remediation Suggestions

  1. Parse the endpoint using a standard URL parser before launching the MCP process.
  2. Require the https scheme and reject URLs containing embedded credentials.
  3. Allowlist the documented production hostname, imiva.ecpro.com, and validate the normalized hostname rather than using substring matching.
  4. Remove the generic API_URL fallback to prevent collisions with unrelated application configuration.
  5. If non-production endpoints are necessary, require an explicit command-line option and prominent confirmation before sending a production token.
  6. Use separate, restricted tokens for development or staging endpoints.
  7. Reject loopback, link-local, private-network, and non-approved destinations unless a documented administrative mode explicitly permits them.
  8. Log the normalized destination hostname without logging tokens or sensitive request contents.
  9. Add tests covering HTTP URLs, deceptive subdomains, embedded credentials, malformed URLs, and environment-variable precedence.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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
Findings (6)

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

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

The skill documents shell commands, environment variable use, and file access patterns but does not declare an explicit tool scope such as allowed-tools or permissions. That creates a least-privilege gap: an agent or client may grant broader shell/file/env capabilities than the skill actually needs, increasing the chance of unintended command execution, local file access, or token exposure during normal use.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The invocation description is very broad and overlaps with common ecommerce and content-generation requests, which can cause the skill to be selected in situations beyond its intended scope. Over-broad routing increases the probability that an agent will hand unrelated user requests, sensitive business context, or media-generation actions to this skill without clear user intent or proper guardrails.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The metadata sets the language to 'zh-CN,' and the description later says it is especially suitable for '中文用户,' indicating a fixed language/locale expectation. The file does not state that users may choose another language or explicitly opt into this locale constraint.

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

The error messages shown to users are hardcoded in Chinese, and the CLI description/help strings elsewhere in the file are also Chinese-only. This creates a language/locale policy issue because the skill does not provide user opt-in, fallback, or documentation that it is intentionally limited to Chinese-speaking users.

Content

No source excerpt is available for this finding.