T09 · Insecure Skill Coding Practices
- Location
config.json:9- Finding
Plaintext MiniMax API Credential Committed to Configuration
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly a coherent AI music workflow, but it packages a plaintext API key and asks agents to perform broad installs, credential handling, and deployment with weak scoping.
Review before installing. Do not use the bundled config.json credential; revoke and remove it if you control it. Provide MiniMax credentials only through a secure secret mechanism, avoid global or system-level installs unless you approve them, and confirm the exact files and destination before running the deployment step.
config.json:9Plaintext MiniMax API Credential Committed to Configuration
SKILL.md:40Automatic Installation of Unpinned Third-Party Dependencies
scripts/calibrate_lyrics.py:543Predictable Shared Temporary Directories Permit Symlink and Data-Collision Attacks
The declared description presents a broad end-to-end AI music creation skill with content generation, media generation, lyric synchronization, page creation, and deployment. The supplied code chunk implements only one narrow subset: lyric timing alignment using Whisper output (or by invoking Whisper on an MP3) and writing a JSON result. While this partially overlaps with the claimed ASR alignment portion, it does not support the primary declared purpose of full music creation and publishing. This is therefore a material description-behavior mismatch.
The declared description presents a comprehensive AI music production pipeline, but the supplied code chunk only constructs a JSON metadata file from command-line arguments and saves it locally. While song metadata could be a supporting part of a music workflow, this code alone does not implement any of the core advertised capabilities. The primary purpose of the code is materially narrower and different from the declared skill behavior, so this is a clear description-behavior mismatch.
The declared description presents a broad full-process music creation skill, but the provided code only implements one narrow component: lyric-to-audio alignment and LRC file generation. That alone would be acceptable as a partial implementation if the description were scoped accordingly, but the declared primary purpose emphasizes additional major capabilities—lyric writing, music generation, cover art generation, synced playback page creation, and deployment—that are absent from this code chunk. Additionally, the code comments/docstring claim 'MFCC + DTW' optimization, yet the implementation imports librosa/numpy/scipy distance tools without actually computing MFCCs or running DTW; instead it uses Whisper word timestamps plus a simple sliding-window text match and fallback interpolation. Therefore the description does not accurately represent what this code chunk actually does.
The skill asks the user to provide an API key directly and then uses it for CLI authentication without explaining storage, retention, redaction, or exposure risks. In agent environments, plaintext credential handling can leak secrets through logs, shell history, config files, screenshots, or subsequent tool output.
The skill directs automatic installation of packages and system-level modifications, including package-manager use and library symlinks, without warning about host integrity, privilege needs, or rollback concerns. This can break environments, widen supply-chain exposure, and surprise users with invasive changes beyond the expected task scope.
Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.
mmx auth login --api-key <用户提供的API_KEY>
mmx text chat --model MiniMax-M2.7 --message "test" --output json
用户提供创作人信息后,Agent 在技能目录创建 `config.json`:
Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.
使用 MiniMax 文本模型生成歌词:
mmx text chat --model MiniMax-M2.7 --message "PROMPT" --output json
Prompt 模板:
The deployment workflow pushes generated artifacts to an external deployment target without clearly warning the user that content may become publicly accessible. Since files include audio, images, lyrics, and metadata, this can result in unintended publication and data disclosure.
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.
]
result = subprocess.run(
cmd, capture_output=True, text=True, timeout=30,
env={**os.environ, "PYTHONIOENCODING": "UTF-8"},
)
if result.returncode != 0:
raise RuntimeError(f"ffprobe 执行失败: {result.stderr}")
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.
]
result = subprocess.run(
cmd, capture_output=True, text=True, timeout=30,
env={**os.environ, "PYTHONIOENCODING": "UTF-8"},
)
if result.returncode != 0:
raise RuntimeError(f"ffprobe 执行失败: {result.stderr}")
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.
]
result = subprocess.run(
cmd, capture_output=True, text=True, timeout=30,
env={**os.environ, "PYTHONIOENCODING": "UTF-8"},
)
if result.returncode != 0:
raise RuntimeError(f"ffprobe 执行失败: {result.stderr}")
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.
]
result = subprocess.run(
cmd, capture_output=True, text=True, timeout=30,
env={**os.environ, "PYTHONIOENCODING": "UTF-8"},
)
if result.returncode != 0:
raise RuntimeError(f"ffprobe 执行失败: {result.stderr}")
The skill describes shell execution, file reads/writes, environment use, package installation, and deployment actions, but it declares no explicit tool scope or permission boundaries. In an agent setting, this increases the chance that broad capabilities are invoked implicitly, making sensitive operations harder to review and constrain.
The trigger list includes broad everyday phrases, which can cause the skill to activate in contexts the user did not intend. Because this skill can request credentials, install software, write files, and publish content, accidental invocation materially increases security and privacy risk.
The skill explicitly instructs the agent to collect and handle a user's API key in ordinary conversation, then pass it into authentication commands. Secret collection through chat and direct command-line use is dangerous because it increases the chance of leakage through transcripts, terminal history, process inspection, or reused context.
The skill instructs the agent to perform global npm and pip installs, OS package installation, and a system library symlink change. These are privileged, system-wide modifications unrelated to a minimally scoped content-creation task and can damage system integrity, introduce supply-chain risk, or alter shared runtime behavior.
L157 明确要求“写歌词,主题是《{主题}》”且指定为“中文歌曲”,文档中未提供按用户偏好选择语言的选项,也未说明该技能仅限中文场景的必要性。根据语言/locale 政策,这属于未获用户选择的语言强制约束。
The skill extends beyond music creation into publication by copying artifacts into another skill's deployment directory and triggering a sync to deploy. This broadens the blast radius from local file generation to external content publication, creating risk of accidental data exposure or unauthorized site changes.
The subprocess command hard-codes --language zh, which imposes a specific language/locale behavior on all runs. The file does not provide a user-facing option to choose another language or explain that this tool is intentionally restricted to Chinese-only usage.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
'--device', 'cpu'
]
print(f"🎵 Running ASR: {' '.join(cmd)}")
subprocess.run(cmd, check=True)
# 找到输出文件
base = os.path.splitext(os.path.basename(mp3_path))[0]
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
if args.duration:
total_duration = args.duration
elif args.mp3:
result = subprocess.run(
['ffprobe', '-v', 'error', '-show_entries', 'format=duration', '-of', 'csv=p=0', args.mp3],
capture_output=True, text=True
)
The command hardcodes --language zh, which enforces a specific language/locale behavior regardless of the input audio or user preference. This is a natural-language policy concern because the file does not offer opt-in, configurability, or a documented region-specific justification for restricting processing to Chinese.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
"-show_format",
mp3_path,
]
result = subprocess.run(
cmd, capture_output=True, text=True, timeout=30,
env={**os.environ, "PYTHONIOENCODING": "UTF-8"},
)
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
"-show_format",
mp3_path,
]
result = subprocess.run(
cmd, capture_output=True, text=True, timeout=30,
env={**os.environ, "PYTHONIOENCODING": "UTF-8"},
)
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
"""运行子进程并记录日志"""
logger.info("▶ %s: %s", description, " ".join(cmd))
env = {**os.environ, "PYTHONIOENCODING": "UTF-8"}
result = subprocess.run(
cmd, capture_output=True, text=True, timeout=timeout, env=env,
)
if result.returncode != 0: