Back to skill

Security audit

AI电商专家|中文文字广告图

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent IMIVA ecommerce ad-generation integration, but it runs an unpinned remote npm package with broad inherited environment access and no local MCP tool allowlist.

Review this before installing. Use only a narrowly scoped IMIVA token, avoid running it in an environment containing unrelated secrets, and prefer a pinned/audited MCP package version with a local allowlist for permitted tools. Disable implicit invocation or require explicit confirmation before billable task creation.

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

T03 · Remote Payload Retrieval and Execution

Error
Location
scripts/imiva_mcp.py:14
Finding

Unpinned npm Package Is Downloaded and Executed Automatically

Content
View full analysis
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 configuration example also recommends the same mutable dependency: ```json { "mcpServers": { "imiva-ecommerce": { "command": "npx", "args": [ "-y", "@infimind/ecom-content-cli@latest" ] } } } ``` ### Technical Analysis The helper invokes `npx` with `-y` and the mutable package selector `@latest`. As a result, the executable code used at runtime is not fixed by the audited project. A later package release can differ completely from the version available during review. The `-y` option automatically accepts package installation without an interactive confirmation. This turns Skill invocation into a remote code retrieval and execution channel. Although the package appears to be the declared IMIVA integration rather than an evident typosquat, its mutable version creates a supply-chain trust boundary that is not controlled by this repository. The downloaded package executes with the operating-system privileges of the user running the Agent. The project provides no integrity verification, package lock, sandbox, or reviewed version constraint. ### Attack Path 1. An ...[truncated 1368 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/imiva_mcp.py:47
Finding

Downloaded MCP Process Inherits the Entire Parent Environment

Content
View full analysis
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 Agent process into the child npm process. The child only requires a limited runtime environment and the IMIVA-specific token and endpoint, but it receives all available variables. Agent and development environments commonly contain unrelated credentials such as cloud access keys, source-control tokens, package registry tokens, proxy credentials, database URLs, signing credentials, and API keys. These credentials are unnecessarily exposed to a remotely obtained third-party package. This violates least privilege. The risk is amplified because the recipient is the mutable `@latest` package described in the preceding finding. The endpoint is also selected from environment variables: ```python env["API_URL"] = os.environ.get( "IMIVA_API_URL", os.environ.get("API_URL", DEFAULT_API_URL) ) ``` The code does not validate that the selected endpoint uses HTTPS or belongs to the expected IMIVA hostname. If an attacker can influence the process environment, the MCP package may be directed to an unintended endpoint while possessing `MCP_TOKEN`. Whether the package transmits that token to the configured endpoint depends on the external package implementation, which is not present in the audited repository. ### Att ...[truncated 1311 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/imiva_mcp.py:101
Finding

Generic MCP Wrapper Permits Calls to Tools Outside the Declared Workflow

Content
View full analysis
None: parser = argparse.ArgumentParser(description="调用 IMIVA Ecommerce MCP") sub = parser.add_subparsers(dest="command", required=True) sub.add_parser("list-tools", help="列出当前 Token 可用工具") call = sub.add_parser("call", help="调用一个 MCP 工具") call.add_argument("tool") call.add_argument("--args") call.add_argument("--args-file") ns = parser.parse_args() if ns.command == "list-tools": response = invoke("tools/list") else: response = invoke("tools/call", {"name": ns.tool, "arguments": load_args(ns.args, ns.args_file)}) print(json.dumps(response, ensure_ascii=False, indent=2)) if "error" in response: raise SystemExit(1) ``` ### Technical Analysis The Skill declares `create_smart_refine_task` as its primary capability and documents credit and task-query operations. However, the wrapper accepts an unrestricted tool name from the command line and forwards it directly through `tools/call`. No local allowlist restricts calls to the tools required by the Chinese advertising-poster workflow. The effective authority is therefore determined by every tool available to the supplied token, including account-specific or future tools not considered during this audit. This is not command injection into a shell: `subprocess.Popen` uses an argument array, and the selected MCP tool name is sent as JSON-RPC data. The weakness is authorization scope. Attacker-influenced instructions can cause the Agent to invoke an otherwise valid but unintended MCP tool. ### Attack Path 1. The MCP token has access to tools beyond `create_smart_refine_task`, credit lookup, and task lookup. 2. An attacker supplies a prompt, copied document, or other instruction that directs the Agent to invoke a ...[truncated 1130 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
Findings (12)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The stated purpose is a narrowly focused Chinese ad-poster workflow, but the skill behavior and instructions show it can list available tools and invoke arbitrary MCP tools by name through a general transport script. That mismatch is dangerous because it obscures the real trust boundary: a user may authorize what appears to be a single-purpose creative skill while actually granting a generic client capable of broader actions under the same token.

Content

No source excerpt is available for this finding.

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
82% confidence
Finding

Using os.environ.copy() forwards the full parent environment into the spawned npm process, not just the token and API URL needed for operation. If sensitive environment variables are present, a malicious or compromised package executed via npx could read and exfiltrate them; this becomes materially more dangerous because the child process is remote-sourced and unaudited at runtime.

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 exposes shell, file-read, and environment-variable capabilities without declaring a restrictive tool scope such as allowed-tools or permissions. In this context, the document includes executable examples that interact with local files, environment secrets, and a helper script, so the undeclared breadth can let the skill operate as a more privileged runner than users would reasonably expect.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The description repeatedly defines the skill around producing '中文文字广告图' and directs use for Chinese-text advertising specifically. Because the file does not present this as an optional locale choice or clearly justify it as a region-specific compliance constraint, it constitutes a language/locale restriction in natural-language instructions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This line says the skill creates commercial ad images around a specified Chinese title and messaging and requires review of the text before delivery. That is a natural-language locale requirement, and the document does not offer users a language choice or note that the restriction is optional.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill enables allow_implicit_invocation without any visible activation constraints, narrowing rules, or user-consent guardrails. This creates a risk that the agent may auto-select or invoke a commerce-content generation workflow in situations where the user did not explicitly request it, which can cause unintended data sharing to connected tools or unreviewed task execution.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script emits error messages only in Chinese, such as when npx or MCP_TOKEN is missing. This imposes a specific language on all users without offering a language choice or documenting that the skill is intentionally limited to a Chinese-speaking context.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
92% confidence
Finding

The script launches npx -y @infimind/ecom-content-cli@latest, which downloads and executes the latest remote npm package at runtime. This creates a software supply-chain risk: a compromised package, malicious dependency, or unexpected upstream update would execute with access to the caller's environment and MCP token. In this skill context, the helper is specifically designed to bridge into an external MCP service, so runtime remote code execution is more dangerous because it sits on a trust boundary and handles credentials.

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

The script executes a remote npm package on demand without any explicit warning to the operator that code will be fetched and run from the network. While this overlaps with the supply-chain risk above, the separate issue is lack of transparency and informed consent, which increases the chance users unknowingly expose tokens, local files, or environment data to third-party code. In an enterprise ecommerce skill that may be run by non-developers, hidden remote execution is especially risky.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The command-line description and help strings are written only in Chinese, which enforces a specific language for all users of the tool. The file does not provide any language selection or state that the tool is region- or locale-specific.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

L012 says the skill is for '完成商品精修与图片编辑' (product retouching and image editing), while the surrounding manifest and documentation consistently position it as a '中文文字广告图' skill focused on commercial ad poster generation. This is an active documentation inconsistency about the skill's intended function, not just an omitted detail.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The example configuration instructs users to run an unpinned package directly from the registry via npx using @latest, which creates a supply-chain risk. If the package is compromised, unpublished and replaced, or a malicious version is published, users could execute attacker-controlled code when starting the MCP server; this is more concerning in this skill because it is presented as an enterprise workflow integration and includes an authentication token in the runtime environment.

Content

No source excerpt is available for this finding.