Back to skill

Security audit

主图点击率 A/B 测试素材

Security checks for vulnerabilities and agentic risk

Overview

The skill fits its IMIVA image-generation purpose, but it needs Review because it runs an unpinned npm MCP package with token and broad environment access and exposes broader MCP calls than the narrow A/B-test workflow requires.

Review before installing. Use a dedicated low-privilege IMIVA token, avoid running this skill in a shell with unrelated secrets, set the API endpoint explicitly to the official IMIVA service, and prefer a pinned reviewed npm package version instead of @latest. Confirm budget and generated-task details before any task is submitted.

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 Dependency Is Downloaded and Executed Without Verification

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 same unsafe dependency specification is presented in the example configuration: ```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 -y @infimind/ecom-content-cli@latest`. The `latest` tag is mutable, so the code executed during a future invocation may differ from the code that was available when the Skill was audited. The `-y` option suppresses the normal installation confirmation, allowing the package to be fetched and executed without explicit user review. This creates a supply-chain trust boundary in which control of the package publisher account, npm package, release process, or mutable distribution tag can change the effective executable payload after this repository has been reviewed. The child process also receives `MCP_TOKEN` and a copy of the parent environment. Consequently, a compromised dependency ...[truncated 1547 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/imiva_mcp.py:50
Finding

MCP Token May Be Sent to an Environment-Controlled API Endpoint

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 The destination assigned to `API_URL` can be overridden through either `IMIVA_API_URL` or the generic inherited `API_URL` environment variable. The helper does not validate: - Whether the endpoint uses HTTPS. - Whether the hostname belongs to the expected IMIVA service. - Whether redirects remain on an approved origin. - Whether a custom endpoint was explicitly approved for use with the supplied token. At the same time, the child process receives `MCP_TOKEN`. If the downstream MCP package authenticates to the configured `API_URL`, an attacker-controlled environment value can cause authenticated traffic to be directed to an unintended server. Using the generic name `API_URL` as a fallback increases the risk of accidental redirection because unrelated development tools, shell profiles, wrappers, or orchestration systems may already define that variable. The use of `os.environ.copy()` additionally exposes all inherited environment variables to the third-party child process, even when they are unrelated to the MCP task. ### Attack Path 1. An attacker or unsafe execution wrapper influences the environment used to launch the helper. 2. `IMIVA_API_URL` or `API_URL` is set to an attacker-controlled endpoint, for example `https://attacker.exampl ...[truncated 1265 chars]
Remediation
View remediation
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
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (9)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill is presented as a narrowly scoped main-image CTR testing workflow, but its instructions include generic MCP tool enumeration and arbitrary tool invocation patterns. That mismatch is security-relevant because users and hosting platforms may grant trust based on the advertised limited purpose while the actual behavior can reach any tool exposed by the MCP token, expanding the attack surface to unintended or higher-risk operations.

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

The skill exposes shell, file-read, and environment-backed execution patterns but does not declare any explicit tool scope or allowed-tools boundary. In practice this weakens least-privilege controls and makes it easier for a caller or future skill modification to invoke capabilities beyond the narrowly advertised workflow, including access to local files and tokens.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest sets metadata.language: zh-CN, and the document consistently frames the skill for Chinese users rather than offering any language choice. Under the stated policy, forcing a specific language or locale without user opt-in is a natural-language policy violation unless clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

Line L059 says the skill is suitable for '中文用户', which is a natural-language restriction to a specific language audience. The file does not provide an opt-in choice or explain a necessary locale constraint, so this conflicts with the language/locale policy guidance.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill enables implicit invocation but does not define narrow activation constraints, so the assistant may auto-trigger this commerce/image-generation workflow in contexts where the user did not clearly intend to use it. Because the skill can initiate budget-sensitive content production and task creation, unintended invocation could cause unwanted actions, data sharing, or user confusion about consent and spending.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This Python file contains natural-language strings that force a specific language for errors and usage text, such as the runtime/token errors. The policy allows locale constraints only when opt-in or clearly justified, and this file does not provide a language choice or explain that it is intentionally Chinese-only.

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

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The argument parser description and help text are presented only in Chinese, which enforces a single locale in user-visible output. Because no opt-in, fallback, or justification is provided, this is a natural-language locale policy violation under the stated rules.

Content

No source excerpt is available for this finding.