Back to skill

Security audit

minimax-music

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a MiniMax music helper, but it needs review because its downloader can fetch any URL and overwrite local files.

Before installing, treat this as a Review item: use it only with a MiniMax API key you intend to expose to the skill, run it in a low-permission workspace, save output under a dedicated folder, and avoid invoking the download command with arbitrary or untrusted URLs until it restricts downloads to MiniMax-generated media and prevents overwrites.

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/music.py:174
Finding

Unrestricted Network Download and Arbitrary File Overwrite

Content
View full analysis

Vulnerability Details

File Location: scripts/music.py, lines 174-182
Vulnerability Type: Server-Side Request Forgery (SSRF), unbounded download, and arbitrary file overwrite
Risk Level: High

python
response = requests.get(music_url, timeout=300, stream=True)
response.raise_for_status()

with open(output_path, "wb") as f:
    for chunk in response.iter_content(chunk_size=8192):
        f.write(chunk)

return output_path

The vulnerable parameters are exposed directly through the command-line interface:

python
dl_parser.add_argument("url", help="音乐URL")
dl_parser.add_argument("-o", "--output", required=True, help="保存路径")

# ...

elif args.command == "download":
    output_path = download_music(args.url, args.output)
    print(f"Music saved to: {output_path}")

Technical Analysis

The download_music() function accepts a caller-controlled URL and passes it directly to requests.get() without validating its scheme, hostname, resolved IP address, port, or redirect destination. A caller can consequently direct the process to HTTP or HTTPS services available from the skill's execution environment, including localhost, private network services, and cloud metadata endpoints.

Requests follows HTTP redirects by default. Therefore, checking only an initial URL in a future calling layer would be insufficient: an allowed public endpoint could redirect the request to a private or otherwise prohibited destination.

The response is streamed directly to a caller-selected output_path. The path is not restricted to a dedicated output directory, normalized and checked for containment, or protected against symbolic-link traversal. Opening it with mode "wb" creates the file if absent and truncates it if present. Any file writable by the process can therefore be replaced with attacker-selected response content.

No maximum response size is enforced. The request timeout does not impose a total ...[truncated 1935 chars]

Remediation
View remediation

Remediation Suggestions

  1. Allowlist download origins

    • Permit only HTTPS URLs.
    • Restrict hosts to documented MiniMax download domains or another explicit CDN allowlist.
    • Reject embedded credentials, unexpected ports, malformed hostnames, and non-HTTP schemes.
  2. Prevent private-network access

    • Resolve the hostname before connecting.
    • Reject loopback, private, link-local, multicast, reserved, and unspecified IPv4 and IPv6 addresses.
    • Account for all returned DNS records and DNS rebinding.
    • Apply equivalent outbound restrictions at the firewall or container level.
  3. Control redirects

    • Disable automatic redirects with allow_redirects=False, or validate the scheme, hostname, port, and resolved addresses of every redirect target before following it.
    • Enforce a small redirect limit.
  4. Restrict output paths

    • Write only beneath a dedicated output directory.
    • Resolve the requested path and verify that it remains inside that directory.
    • Generate server-controlled filenames where possible.
    • Reject absolute paths, parent-directory traversal, symbolic links, and special files.
    • Avoid overwriting existing files unless explicitly required and safely authorized.
  5. Use safe file creation

    • Create files with restrictive permissions.
    • Use exclusive creation or a secure temporary file followed by an atomic rename.
    • Validate the final destination again immediately before committing the file.
  6. Limit downloaded content

    • Set a maximum permitted byte count and abort once exceeded.
    • Validate Content-Length when present, while still enforcing a streaming byte counter.
    • Verify the expected content type and validate that the downloaded data is a supported audio format.
  7. Reduce privileges

    • Run the skill under a dedicated low-privilege account.
    • Limit outbound network access and filesystem write permission ...[truncated 43 chars]
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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 (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
84% confidence
Finding

The documented behavior does not align with the described implementation details: claimed async music generation and lyric-structure support are not consistently reflected, and the task query path appears to reference video generation instead of music. These mismatches can cause users or orchestrators to rely on unsafe assumptions about what the skill does, including where data is sent and how outputs are handled.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill advertises use of environment variables and network access but does not declare any explicit tool scope such as permissions or allowed-tools. This weakens reviewability and least-privilege controls, making it easier for a host agent to grant broader capabilities than users expect.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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
# API 配置
BASE_URL_CN = "https://api.minimaxi.com/v1"
BASE_URL_INT = "https://api.minimax.io/v1"

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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/music.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"

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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
# API 配置
BASE_URL_CN = "https://api.minimaxi.com/v1"
BASE_URL_INT = "https://api.minimax.io/v1"


def get_base_url() -> str:

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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/music.py (reported line 19)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:

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The function name and docstring describe querying music-generation task status, but the implementation sends the request to /query/video_generation. This is an active contradiction between the documented intent and the coded behavior, and could misroute data or produce unexpected results.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The CLI exposes a generic download command that accepts any user-supplied URL and writes the response to an arbitrary local path, which goes beyond the stated music-generation purpose. In an agent or automation context, this can be abused as an SSRF/open-fetch primitive to access internal services or retrieve untrusted content and store it locally.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The skill explicitly promotes automatic local download and save of generated MP3 files without warning about overwrite behavior, destination control, or filesystem impact. If used carelessly, this can lead to accidental overwriting of user files or writing untrusted remote content to sensitive locations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The entire skill reference is written in Chinese and does not indicate that other languages are supported or that the language choice is optional. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation unless the constraint is clearly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

This code mixes an English title with Chinese-only functional description text, and the rest of the user-facing help strings are also Chinese-oriented. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy issue unless the tool explicitly offers a language choice or documents a justified locale constraint.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.