Back to skill

Security audit

Music Studio

Security checks for vulnerabilities and agentic risk

Overview

The skill’s music-generation purpose is coherent, but it should be reviewed because it can retain API keys insecurely and perform overly broad local file deletion/download operations.

Install only if you are comfortable giving it a MiniMax API key and sending prompts, lyrics, and cover-audio URLs to MiniMax. Use a dedicated output directory, avoid shared machines, rotate the API key after testing, and be careful with clean/reset commands until credential storage, session redaction, download validation, and deletion scoping are fixed.

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

T09 · Insecure Skill Coding Practices

Error
Location
music_studio/conversation/engine.py:28
Finding

API Key Is Persisted Verbatim in Conversation History

Content
View full analysis
None: session = _read_session(sid) now = _now() session.setdefault("messages", []).append({ "role": role, "content": content, "time": now, }) session["updated"] = now _write_session(sid, session) ``` ### Technical Analysis The setup engine records every user message before passing it to the setup flow. At setup step 1, the entire user message is interpreted as the MiniMax API key. Consequently, the key is written verbatim to the conversation session file in addition to its intended storage in `config.json`. This creates an unnecessary secondary credential store under `output/sessions/.json`. Session records are retained for up to 30 days, and the reset implementation does not reliably remove them ...[truncated 1041 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
music_studio/config.py:15
Finding

Credential and Session Files Are Created Without Restrictive Permissions

Content
View full analysis
None: CONFIG_FILE.parent.mkdir(parents=True, exist_ok=True) def load_config() -> dict[str, Any]: if not CONFIG_FILE.exists(): return {} with open(CONFIG_FILE) as f: return json.load(f) def save_config(data: dict[str, Any]) -> None: ensure_config_dir() data = dict(data) data["updated"] = _now() with open(CONFIG_FILE, "w") as f: json.dump(data, f, indent=2, ensure_ascii=False) ``` ```python # music_studio/session_manager/manager.py:21-23 def _ensure_dir() -> None: SESSIONS_DIR().mkdir(parents=True, exist_ok=True) ``` ```python # music_studio/session_manager/manager.py:50-54 def _write_session(sid: str, data: dict[str, Any]) -> None: _ensure_dir() p = _session_path(sid) with open(p, "w") as f: json.dump(data, f, indent=2, ensure_ascii=False) ``` ```python # music_studio/session_manager/manager.py:181-185 def _set_active(sid: str) -> None: _ensure_dir() ACTIVE_FILE().write_text(sid) ``` ### Technical Analysis The configuration directory, session directory, configuration file, session files, and active-session marker are created using default operating-system permissions. Their effective modes therefore depend entirely on the process umask. Under a common `022` umask, newly created files may be mode `0644` and directories may be mode `0755`. On a multi-user system, this can permit other local accounts to read `config.json`, which contains the API key, and session files, which contain private prompts and may also contain the key due to the separate setup-history flaw. ### Attack Path 1. Music Studio is executed on a shared system with a permissi ...[truncated 825 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
music_studio/scripts/clean.py:10
Finding

Cleanup Deletes Unrelated Files from Arbitrary Custom Output Directories

Content
View full analysis
Path: """Return the output directory, supporting a custom user path.""" cfg = load_config() custom: str = cfg.get("output_dir", "") if custom: p = Path(custom).expanduser().resolve() p.mkdir(parents=True, exist_ok=True) return p DEFAULT_OUTPUT_DIR.mkdir(parents=True, exist_ok=True) return DEFAULT_OUTPUT_DIR ``` ```python # music_studio/scripts/clean.py:10-23 output_dir = lib_mod.OUTPUT_DIR() now = time.time() count = 0 for file in output_dir.iterdir(): if not file.is_file(): continue if file.name in ("library.json", ".gitkeep"): continue mtime = file.stat().st_mtime age_days = (now - mtime) / 86400 if age_days > 30: print(f"Deleting: {file.name}") file.unlink() count += 1 ``` ### Technical Analysis The application permits any filesystem directory to be configured as the output directory. The cleanup command then enumerates every top-level regular file in that directory and deletes files older than 30 days, excluding only two filenames. Deletion is not restricted to files recorded in `library.json`, files with known Music Studio extensions, or files carrying an application ownership marker. Therefore, selecting a home directory, shared media directory, mounted drive, or other existing directory can cause unrelated user data to be removed. The cleanup command also performs these deletions without an interactive confirmation or preview. ### Attack Path 1. A user or a process capable of modifying `config.json` sets `output_dir` to a broad existing directory. 2. That directory contains unrelated regular files older than 30 days. 3. The user invokes `python -m music_studio clean ...[truncated 685 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
music_studio/scripts/reset.py:8
Finding

Reset Purges the Wrong Directory and Leaves Session Secrets Behind

Content
View full analysis
None: od = OUTPUT_DIR() lf = LIBRARY_FILE() if lf.exists(): lf.unlink() for pattern in ("*.url", "*.txt", "*.hex", "*.mp3"): for f in od.glob(pattern): f.unlink() ``` ### Technical Analysis The reset function captures `current_output`, but it does not pass that path to `purge_all()`. Instead, it deletes `config.json` first. `purge_all()` subsequently calls `OUTPUT_DIR()`, which reloads configuration and falls back to the default output directory because the custom path setting has already been erased. As a result, a custom output directory is not purged, while files in the default output directory may be deleted instead. Additionally, `purge_all()` only removes selected top-level file extensions and `library.json`; it does not remove the `sessions/` directory. Session files can contain private conversation history and, through the setup-history vulnerability, plaintext API keys. ### Atta ...[truncated 910 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
music_studio/scripts/music.py:13
Finding

Audio Downloads Accept Unrestricted URLs and Read Responses Without Size Limits

Content
View full analysis
bytes: req = urllib.request.Request(url, headers={"User-Agent": "Mozilla/5.0"}) with urllib.request.urlopen(req, timeout=timeout) as resp: return resp.read() def _save_audio_from_url( title: str, audio_url: str ) -> tuple[str | None, str | None]: try: data_bytes = _download_url(audio_url) mp3_path = ( lib_mod.OUTPUT_DIR() / f"{_sanitize_filename(title, 'music')}.mp3" ) mp3_path.write_bytes(data_bytes) return str(mp3_path), None ``` ```python # music_studio/scripts/library.py:30-34 def _download_to_path(url: str, out_file): req = urllib.request.Request(url, headers={"User-Agent": "Mozilla/5.0"}) with urllib.request.urlopen(req, timeout=60) as resp: data = resp.read() out_file.write_bytes(data) return len(data) ``` ### Technical Analysis All download helpers pass URLs directly to `urllib.request.u ...[truncated 2356 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
  • 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 (37)

Tp4

High
Category
MCP Tool Poisoning
Confidence
86% confidence
Finding

The published purpose focuses on music generation, but the skill also references repository scanning, secret detection, git/subprocess-based prepublish checks, and release-gating behavior. These auxiliary maintenance features broaden the operational surface into shell and repository inspection, which can be risky if they are not clearly separated from end-user functionality and permissioned appropriately.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The published purpose focuses on music generation, but the skill also references repository scanning, secret detection, git/subprocess-based prepublish checks, and release-gating behavior. These auxiliary maintenance features broaden the operational surface into shell and repository inspection, which can be risky if they are not clearly separated from end-user functionality and permissioned appropriately.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The published purpose focuses on music generation, but the skill also references repository scanning, secret detection, git/subprocess-based prepublish checks, and release-gating behavior. These auxiliary maintenance features broaden the operational surface into shell and repository inspection, which can be risky if they are not clearly separated from end-user functionality and permissioned appropriately.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill advertises capabilities that include network, file read/write, shell, env, and MCP access, but the manifest does not declare any explicit tool scope or permissions boundaries. This weakens least-privilege controls and makes it harder for a host platform to constrain what the skill may access, increasing the blast radius if the skill is misused or later modified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest description is entirely in Chinese and presents the interaction model as fixed, which can amount to a language/locale policy issue when no user choice is offered. The file does not indicate that other languages are supported or that Chinese is an optional/default preference the user can change.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The save_config function writes arbitrary configuration data to config.json, and elsewhere this module clearly stores an api_key in that config. There is no confirmation prompt, user-facing log, or inline warning here indicating that sensitive settings will be persisted locally.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code embeds user-facing prompts, status messages, and primary trigger phrases in Chinese, effectively requiring Chinese interaction to use core functionality. Under the policy rule, forcing a specific language without opt-in is a natural-language policy violation unless the locale restriction is explicitly justified or user choice is offered.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The activation gate is broader than the declared security boundary in the skill metadata. Because the code enters the music-studio flow on generic phrases like “音乐工作室”, “我要写歌词”, or “我要翻唱”, other agent contexts or casual user utterances can unintentionally activate this skill, expanding its effective privilege and increasing the chance of unintended actions or data handling.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

All user-facing strings in this file are written in Chinese and the interaction flow assumes Chinese commands such as “确认”, “返回”, and “取消”. There is no indication that users may choose another language or locale, which can violate a language-choice policy when not explicitly justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The setup flow asks the user to paste an API key and immediately validates it by sending it to the external provider via client.lyrics_generation(prompt="test"), but the user-facing prompt does not clearly disclose that the key will be transmitted off-host for verification. This creates a privacy and consent issue: users may believe they are only storing a local configuration, while in fact the secret is used in a live outbound request during setup.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

In the cover flow, the user-supplied reference audio URL is forwarded to external preprocessing and generation APIs (music_cover_preprocess and subsequent generation) without an explicit warning at the submission point. Because reference audio may contain copyrighted, private, or biometric voice data, silent transmission to third parties can expose sensitive content and create legal/privacy risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The purge_all function irreversibly removes library.json and matching .url, .txt, .hex, and .mp3 files via unlink(), but there is no confirmation prompt, print/log message, or explanatory docstring/comment warning the user about this destructive behavior. This matches the missing user warnings criterion for code files because file deletions are safety-critical operations lacking visible disclosure in the file.

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 · music_studio/providers/minimax.py (reported line 13)May include surrounding context.

python
class MiniMaxProvider(MusicAPIBase):
    """MiniMax 音乐 API"""

    BASE_URL = "https://api.minimaxi.com/v1"

    def __init__(self, api_key: str):
        self.api_key = api_key

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 8)May include surrounding context.

md
class MiniMaxProvider(MusicAPIBase):
    """MiniMax 音乐 API"""

    BASE_URL = "https://api.minimaxi.com/v1"

    def __init__(self, api_key: str):
        self.api_key = api_key

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code sends a user-supplied reference audio URL to a remote preprocessing API and then uses returned derived data in a second remote generation call, but the command flow does not present an explicit warning or consent step that the audio and extracted lyrics/features will be processed by an external provider. In a music-creation tool, users may supply copyrighted, private, or sensitive voice recordings; silent transmission to third-party services creates privacy, compliance, and data-handling risk even if this is the expected product behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The help text advertises destructive commands like library purge and cleanup operations without clearly warning that they can irreversibly delete local records and files. In a CLI/tooling context, concise help text is often copied verbatim into user workflows, so omission of a warning can contribute to accidental data loss even though no code execution flaw is present in this file itself.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script explicitly stores the user's API key in config.json on disk and only states that it will be saved, without warning about plaintext credential storage or validating file permissions. If the config directory is readable by other local users, accidentally committed, backed up insecurely, or exposed through logs/support bundles, the API key can be reused to access the provider account and incur cost or abuse.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script sends user-provided prompts, titles, and optional existing lyrics to a remote provider API, but the code shows no explicit notice or consent step before transmitting potentially sensitive creative content off-device. In a music-creation skill, users may reasonably input unpublished lyrics or proprietary material, so silent remote transmission creates a real privacy and confidentiality risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script persists generated lyrics and metadata, including the original prompt and style tags, to local files without warning the user that their content will be stored on disk. This can expose sensitive or unpublished material to other local users, backups, indexing tools, or later unintended disclosure, especially because the prompt is written verbatim into metadata.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The module description and all CLI messages are presented in Chinese, which imposes a specific language on users. Under the stated policy, locale-specific behavior should either be user-selectable or clearly documented as a justified regional constraint.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The code takes an audio URL returned by the upstream API and fetches it directly with urllib, then writes the response to disk without validating the scheme, host, content type, or size. If the provider response is compromised or misconfigured, this creates an SSRF-style outbound fetch and arbitrary file download path that could access internal resources or store unexpected content locally.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The validation routine sends the supplied API key to an external provider by creating a client and making a live lyrics_generation request, but the script does not explicitly disclose that verification involves network transmission. Users may assume validation is local, causing unintentional disclosure of sensitive credentials to a third party and potentially generating provider-side logs or charges.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The command stores the API key directly in config.json after validation, but the user is not clearly warned beforehand that the credential will be written to disk in plaintext or equivalent local storage. This can expose the key to other local users, backups, source-control mistakes, or malware that reads configuration files.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The top-level docstring is entirely in Chinese, and later user-facing error text also uses Chinese, which imposes a specific language/locale in natural-language content. The file does not indicate that this is a region-specific tool or provide any language selection or opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The raised ValueError contains a Chinese-only message ("会话 {sid} 不存在"), which is a natural-language locale constraint visible to users. There is no surrounding mechanism for language preference, fallback, or justification for a Chinese-only interface.

Content

No source excerpt is available for this finding.