Back to skill

Security audit

AI电商专家|电商图片视频全套生成

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its ecommerce media-generation purpose, but it asks users to run a mutable npm package with an account token and broad local environment access.

Review this skill before installing. Use it only with an IMIVA token you are comfortable granting to the MCP package, avoid running it from an environment containing unrelated API keys, monitor credit-spending actions, and prefer a pinned, reviewed package version or a restricted runtime if available.

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 Downloaded and Executed with Sensitive Environment Access

Content
View full analysis

Vulnerability Details

File Location: scripts/imiva_mcp.py:13,45-53; references/mcp-config.example.json:5-8; SKILL.md:83,106-111
Vulnerability Type: Mutable third-party dependency execution
Risk Level: High

Vulnerable Code

scripts/imiva_mcp.py:13

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

scripts/imiva_mcp.py:45-53

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:5-8

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

The same mutable package invocation is also recommended in SKILL.md:83,106-111.

Technical Analysis

The helper invokes npx with the -y option and the mutable dependency specifier @infimind/ecom-content-cli@latest. This permits npm to retrieve and execute whichever package release is associated with the latest distribution tag at invocation time. Consequently, the effective executable code can change after this project has been reviewed without any corresponding modification to the audited repository.

No exact version, lockfile, package integrity hash, or vendored audited artifact constrains the downloaded code. In addition, the child process receives a copy of the caller's complete environment through os.environ.copy(), including the explicitly supplied MCP_TOKEN and potentially unrelated credentials held in other environment variables.

This finding does not establish that the current npm package is malicious. The vulnerability is the unsafe trust model: a future compromised publisher account, npm registry incident, malicious package update, or compromised upstream releas ...[truncated 1818 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace @infimind/ecom-content-cli@latest with an exact, reviewed version, such as @infimind/ecom-content-cli@X.Y.Z. Do not use version ranges or mutable distribution tags.
  2. Install the dependency during a controlled build or setup phase rather than downloading it whenever the Skill runs.
  3. Commit and enforce an npm lockfile with integrity metadata. Use npm ci in a trusted environment so dependency resolution fails when the lockfile and package metadata differ.
  4. Verify package provenance and integrity before release, including publisher identity, registry source, cryptographic integrity, and the complete transitive dependency tree.
  5. Update the package only through a documented review process that includes source inspection, dependency-diff review, and security testing.
  6. Replace os.environ.copy() with a minimal child-process environment. Pass only essential runtime variables such as PATH, MCP_TOKEN, and the intended API URL; omit unrelated credentials.
  7. Run the MCP package in a restricted execution environment with limited filesystem access, network egress controls, and no unnecessary operating-system privileges.
  8. Update SKILL.md and references/mcp-config.example.json to use the same pinned version so users are not instructed to bypass the hardened implementation.
  9. Consider distributing a pre-reviewed local executable or vendored dependency artifact whose checksum is verified before execution.
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
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (7)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill is presented as a dedicated ecommerce image/video generation workflow, but the documented behavior includes generic MCP transport features such as listing tools and invoking broader IMIVA capabilities. This mismatch is dangerous because users or orchestrators may grant trust appropriate for a narrow workflow while the skill can enumerate and reach a wider tool surface, enabling unintended actions, data access, or billing-impacting operations. The risk is amplified by the presence of task creation, token-based authentication, and helper-script command examples that look like a generic client wrapper.

Content

No source excerpt is available for this finding.

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

The skill documents and demonstrates shell execution, environment-variable use, and file-path handling, but does not declare any explicit tool scope such as allowed-tools or permissions. That creates an overbroad execution surface where a caller may reasonably expect a narrow ecommerce workflow, while the skill can access local files, tokens in env, and shell-capable helper scripts. In this context the risk is increased because the skill explicitly handles MCP tokens and local media paths, so undeclared capabilities could expose credentials or local data beyond user expectations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The manifest-like metadata sets language: zh-CN, and the document also targets '中文用户' without stating that this is an optional default or a region-specific compliance requirement. Under the policy, forcing a specific language/locale without user opt-in is a natural-language policy violation.

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, short description, and default prompt are all written in Chinese, which indicates a fixed language/locale experience. The file does not offer any user opt-in, alternative locale, or justification that this skill is region-specific, so this is a natural-language locale policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The error strings presented to users are written only in Chinese, and the CLI description/help text also uses Chinese elsewhere in the file. Because the script does not offer any language selection or explain that it is intentionally region-specific, this is a natural-language locale policy concern.

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,