Back to skill

Security audit

minimax-img

Security checks for vulnerabilities and agentic risk

Overview

The skill performs the advertised image generation, but it also contains undeclared text-to-speech behavior and overbroad network handling that could expose user content or an API key.

Review this before installing. Use it only if you are comfortable sending prompts, and potentially TTS text if invoked, to MiniMax or the configured endpoint. Prefer a revised version that documents or removes TTS, restricts MINIMAX_BASE_URL to trusted HTTPS MiniMax hosts, validates generated media download URLs and sizes, and replaces tempfile.mktemp with secure temporary-file creation.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/minimax_media.py:17
Finding

API Credentials and User Content Can Be Sent to an Unrestricted Configurable Endpoint

Content
View full analysis
dict: url = f"{BASE_URL}/v1/image_generation" headers = { 'Authorization': f'Bearer {API_KEY}', 'Content-Type': 'application/json' } payload = { 'model': 'image-01', 'prompt': prompt } resp = requests.post(url, headers=headers, json=payload, timeout=60) ``` The same destination and authorization pattern is also used by the TTS implementation at lines 61–80. ### Technical Analysis The Skill must send an API credential and user-provided content to MiniMax to perform its declared image-generation function. That network access is necessary when the destination is the official MiniMax service. However, `MINIMAX_BASE_URL` is accepted without validating its scheme or hostname. The value directly controls the destination receiving the `Authorization: Bearer` header, image prompts, and TTS text. If an attacker can manipulate the process environment or deployment configuration, the attacker can redirect these values to an arbitrary server. This exceeds the minimum privileges needed by the declared functionality. The Skill only needs to contact the official MiniMax HTTPS API, not an unrestricted environment-selected destination. The TTS capability also expands the types of user content transmitted and is not declared in `README.md` or `SKILL.md`. ### Attack Path 1. An attacker gains influence over the environment or launch configuration used to run the Skill. 2. The attacker sets `MINIMAX_BASE_URL` to an attacker-controlled endpoint, such as `https://attacker.example`. 3. A user i ...[truncated 848 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/minimax_media.py:37
Finding

Server-Controlled Image URL Enables Unrestricted Outbound Requests and Unbounded Downloads

Content
View full analysis
Remediation
View remediation
MAX_IMAGE_BYTES: raise ValueError("Image exceeds the maximum permitted size") output.write(chunk) ``` ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/minimax_media.py:51
Finding

Race-Prone Temporary File Creation Can Overwrite Unintended Files

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • 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 (16)

Tainted flow: 'url' from os.environ.get (line 61, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/minimax_media.py (reported line 32)May include surrounding context.

python
'model': 'image-01',
        'prompt': prompt
    }
    resp = requests.post(url, headers=headers, json=payload, timeout=60)
    if resp.status_code != 200:
        return {"error": f"API error {resp.status_code}: {resp.text[:200]}"}

Tainted flow: 'url' from os.environ.get (line 61, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/minimax_media.py (reported line 79)May include surrounding context.

python
'model': 'image-01',
        'prompt': prompt
    }
    resp = requests.post(url, headers=headers, json=payload, timeout=60)
    if resp.status_code != 200:
        return {"error": f"API error {resp.status_code}: {resp.text[:200]}"}

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared purpose is image generation, but analysis indicates additional undeclared TTS/audio functionality and an extra CLI command. Hidden or undocumented capabilities are dangerous because they expand the attack surface, bypass user expectations, and may enable unreviewed data flows or misuse beyond the approved skill scope.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The file header and usage text explicitly advertise text-to-speech functionality even though the skill metadata describes only image generation. Capability mismatch is dangerous in agent skills because users, reviewers, and policy controls may approve the skill for one data flow while the code implements another that transmits text externally and writes audio files locally.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

This section calls a speech synthesis API, transmits user-provided text, decodes returned audio, and writes an audio file to disk, none of which matches the declared image-only purpose. Hidden or undeclared capabilities materially increase security and privacy risk because they bypass user expectations and any manifest-based governance.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill advertises executable behavior that uses environment variables and network access but does not declare any tool scope or permissions. This weakens transparency and reviewability, increasing the risk that the skill can exfiltrate secrets such as API keys or make unexpected outbound requests without clear user consent.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% 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 · scripts/minimax_media.py (reported line 32)May include surrounding context.

python
'model': 'image-01',
        'prompt': prompt
    }
    resp = requests.post(url, headers=headers, json=payload, timeout=60)
    if resp.status_code != 200:
        return {"error": f"API error {resp.status_code}: {resp.text[:200]}"}

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% 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 · scripts/minimax_media.py (reported line 79)May include surrounding context.

python
'model': 'image-01',
        'prompt': prompt
    }
    resp = requests.post(url, headers=headers, json=payload, timeout=60)
    if resp.status_code != 200:
        return {"error": f"API error {resp.status_code}: {resp.text[:200]}"}

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

User prompt text is sent to an external API without any in-tool disclosure or consent messaging. In this skill context that is significant because prompts may contain sensitive user data, and the skill description does not clearly state that content leaves the local environment for third-party processing.

Content

No source excerpt is available for this finding.

Tainted flow: 'image_urls' from requests.post (line 37, network input) → requests.get (network output)

Medium
Category
Data Flow
Confidence
90% confidence
Finding

The code blindly fetches image_urls[0] returned by the remote API, creating a server-side request forgery style trust issue where a compromised or malicious API/base URL can make the tool request arbitrary URLs. In this skill context, that is more dangerous because the tool also supports custom BASE_URL, so both the API response and subsequent download destination can be influenced outside the code's trust boundary.

Content

Scanner excerpt · scripts/minimax_media.py (reported line 42)May include surrounding context.

python
return {"error": "No image URL returned"}
    
    # 下載圖片
    img_resp = requests.get(image_urls[0], timeout=60)
    if img_resp.status_code != 200:
        return {"error": f"Failed to download image: {img_resp.status_code}"}

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The TTS function sends arbitrary user text to an external speech API without explicit disclosure. This is especially concerning because the TTS capability itself is undeclared in the manifest, compounding the surprise and privacy impact of the transmission.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The CLI exposes a tts command that is not described in the manifest, creating an undeclared operational pathway. In an agent ecosystem, undocumented commands are risky because they can expand what the skill can do beyond what installers and reviewers intended.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The README describes image generation usage but does not disclose that user prompts are transmitted to MiniMax's external API and that resulting images are downloaded from an external CDN. This can create an avoidable privacy and data-handling risk because users may submit sensitive prompts without understanding that their content leaves the local environment.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The skill mentions returning a CDN URL and local image path, but it does not clearly warn users that generated content is downloaded from an external CDN and written to local storage. This is a transparency and safety issue because users may unknowingly permit external content retrieval and local file creation, which can have privacy, storage, and policy implications.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

When no output path is provided, the tool silently creates a local PNG file in a temporary location and returns the path. This is lower severity than network exfiltration, but still a privacy and transparency issue because users may not expect persistent local artifacts to be created automatically.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The TTS output is written to a local MP3 file when no output path is specified, without explicit user-facing notice. While not an exploit by itself, unexpected artifact creation can expose sensitive synthesized content to other local users or processes.

Content

No source excerpt is available for this finding.