Back to skill

Security audit

minimax-image

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a real MiniMax image-generation skill, but it needs review because it can upload prompts/images externally and includes an unrestricted URL downloader that writes to caller-chosen local paths.

Review before installing. Use only with prompts and reference images you are willing to send to MiniMax, keep the API key scoped, and avoid letting untrusted content choose image URLs or output paths. Prefer saving only into a dedicated output directory and do not use the standalone downloader on arbitrary URLs.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/image.py:157
Finding

Unrestricted URL Fetch and Arbitrary File Write

Content
View full analysis
str: """ 下载图片到本地 Args: image_url: 图片URL output_path: 保存路径 Returns: 保存的文件路径 """ response = requests.get(image_url, timeout=60) response.raise_for_status() with open(output_path, "wb") as f: f.write(response.content) return output_path ``` ### Technical Analysis The `download_image()` function accepts a URL and output path without applying security restrictions to either value. The URL is passed directly to `requests.get()`. The function does not: - Restrict requests to HTTPS. - Enforce an allowlist of trusted image hosts. - Reject loopback, private, link-local, or reserved IP addresses. - Revalidate the destination after DNS resolution. - Disable or validate HTTP redirects. - Confirm that the response contains an image. - Limit the downloaded response size. - Stream the response incrementally. Consequently, an attacker who controls `image_url` can make the process issue requests to services accessible from its execution environment. Potential targets include localhost services, private-network systems, and cloud instance metadata endpoints. The response is loaded into memory through `response.content` and then written to the caller-supplied `output_path`. The path is not constrained to a designated output directory, normalized against an allowed root, or checked for symlink and overwrite conditions. An attacker can therefore replace any file writable by the process with the fetched response. Although normal image generation obtains the download URL from the MiniMax API response, `SKILL.md` documents `download_image(image_url, output_path)` as a directly available function. Both ...[truncated 1988 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (10)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill documents use of environment variables and external API/network access but does not declare any explicit tool scope such as permissions or allowed-tools. This weakens least-privilege controls and can cause the agent runtime or user to underestimate what resources the skill may access.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill sends user prompts and possibly reference images to a third-party MiniMax API, but the description does not warn users that their content leaves the local environment. This creates a privacy and data-handling risk, especially if users provide sensitive images, internal artwork, or confidential prompts.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/api.md (reported line 5)May include surrounding context.

md
## 基础配置

- **国内用户**: `https://api.minimaxi.com/v1`
- **国际用户**: `https://api.minimax.io/v1`
- **认证方式**: `Authorization: Bearer $MINIMAX_API_KEY`

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/api.md (reported line 6)May include surrounding context.

md
## 基础配置

- **国内用户**: `https://api.minimaxi.com/v1`
- **国际用户**: `https://api.minimax.io/v1`
- **认证方式**: `Authorization: Bearer $MINIMAX_API_KEY`

## API 端点

External Transmission

Medium
Category
Data Exfiltration
Confidence
91% confidence
Finding

The skill transmits user prompts and, in image-to-image mode, potentially local image contents to an external third-party service. In an agent-skill context this matters because prompts and files may contain sensitive information, and users may not realize local files are being uploaded off-host.

Content

Scanner excerpt · scripts/image.py (reported line 17)May include surrounding context.

python
# API 配置
BASE_URL_CN = "https://api.minimaxi.com/v1"
BASE_URL_INT = "https://api.minimax.io/v1"

External Transmission

Medium
Category
Data Exfiltration
Confidence
91% confidence
Finding

The alternate international endpoint also represents external transmission of potentially sensitive prompts and image data to a third-party service. The risk is contextual rather than overtly malicious, but in a skill environment it can expose private data across regions depending on environment configuration.

Content

Scanner excerpt · scripts/image.py (reported line 18)May include surrounding context.

python
# API 配置
BASE_URL_CN = "https://api.minimaxi.com/v1"
BASE_URL_INT = "https://api.minimax.io/v1"


def get_base_url() -> str:

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The skill supports downloading images and saving base64-decoded data to local paths, but does not warn that it writes files to disk. This can lead to unexpected local file creation or overwriting if users do not understand the side effects of these commands.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The natural-language description presents the skill behavior in Chinese only ("图片生成、图片编辑等功能") and does not indicate that users may choose another language or that the language choice is intentionally constrained. Under the policy rule, forcing a specific language without opt-in can be a locale/language policy issue.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The docstring states the function '根据文本描述生成图片并保存到本地' and the return value is '保存的本地文件路径'. However, the implementation behavior is conditional on response_format: it may process API-provided base64 data or download from a returned URL, meaning the documented behavior is narrower than what the code actually does and obscures the additional network fetch step.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The documentation describes image-to-image generation from a reference image and returning a saved local file path, but does not mention that when image_file is supplied, the code reads the local file and sends its contents to the external MiniMax API as a data URI. That omission changes the operational intent in a meaningful way because local file contents are exfiltrated to a remote service.

Content

No source excerpt is available for this finding.