T09 · Insecure Skill Coding Practices
- Location
scripts/minimax_music.py:277- Finding
API Credentials Can Be Exposed Through Command-Line Arguments
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly matches its music-generation purpose, but it includes under-scoped third-party sharing and avoidable credential/download handling risks that users should review before installing.
Install only if you are comfortable sending prompts, lyrics, and generated audio to MiniMax, and potentially to Feishu when sharing is used. Prefer MINIMAX_API_KEY over --api-key, avoid sensitive or proprietary lyrics/prompts, and only use Feishu sharing after confirming the recipient and token scope.
scripts/minimax_music.py:277API Credentials Can Be Exposed Through Command-Line Arguments
scripts/minimax_music.py:151Unvalidated API-Controlled Audio URL Permits Unsafe Outbound Requests and Unbounded Downloads
The skill documents use of environment variables, filesystem access, and outbound network requests, but the manifest declares no explicit tool scope or permissions. This weakens least-privilege controls and can allow the skill to be invoked with broader capabilities than users or the platform expect.
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
---
name: minimax-music
description: "Generate AI music using MiniMax Music 2.5 API. Use when the user wants to: (1) generate instrumental/pure music, (2) generate songs with lyrics, (3) generate lyrics for songs. Supports various music styles (piano, pop, electronic, etc.) and Chinese/English lyrics. Triggers on phrases like '生成音乐', 'create music', '帮我写首歌', '生成纯音乐', 'AI作曲'."
---
# MiniMax Music Generation
The manifest uses broad trigger phrases like 'create music' and '帮我写首歌' without clear activation boundaries or confirmation requirements. This can cause overbroad routing, making the agent invoke a network-enabled skill in contexts where the user did not clearly consent to third-party processing or file generation.
The skill instructs sending generated audio to Feishu, but provides no privacy notice, consent step, or disclosure that user prompts, lyrics, or generated media may be transmitted to a third-party platform. This creates a real risk of unintended disclosure of user content and metadata.
This code performs an outbound upload of a generated audio file to Feishu. Even if functionality is intended, external transmission of generated content can leak sensitive lyrics, prompts, or embedded metadata if performed without explicit consent and proper scoping.
# 1. Upload audio file
with open("music.mp3", "rb") as f:
upload_resp = requests.post(
"https://open.feishu.cn/open-apis/im/v1/files",
headers={"Authorization": f"Bearer {TENANT_ACCESS_TOKEN}"},
files={"file": ("music.mp3", f, "audio/mpeg")},
This request sends a message via Feishu referencing the uploaded file, which extends third-party disclosure beyond local generation. In the context of a skill, messaging actions can create unintended data sharing if triggered automatically or without clear user awareness.
file_key = upload_resp.json()["data"]["file_key"]
# 2. Send file message
requests.post(
"https://open.feishu.cn/open-apis/im/v1/messages?receive_id_type=open_id",
headers={"Authorization": f"Bearer {TENANT_ACCESS_TOKEN}", "Content-Type": "application/json"},
json={
This request sends a message via Feishu referencing the uploaded file, which extends third-party disclosure beyond local generation. In the context of a skill, messaging actions can create unintended data sharing if triggered automatically or without clear user awareness.
file_key = upload_resp.json()["data"]["file_key"]
# 2. Send file message
requests.post(
"https://open.feishu.cn/open-apis/im/v1/messages?receive_id_type=open_id",
headers={"Authorization": f"Bearer {TENANT_ACCESS_TOKEN}", "Content-Type": "application/json"},
json={
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# Configuration
# ============================================================================
API_BASE_URL = "https://api.minimaxi.com/v1"
MUSIC_GENERATION_URL = f"{API_BASE_URL}/music_generation"
LYRICS_GENERATION_URL = f"{API_BASE_URL}/lyrics_generation"
DEFAULT_MODEL = "music-2.5"
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"output_format": output_format
}
response = requests.post(
MUSIC_GENERATION_URL,
json=payload,
headers=self._headers(),
The script sends user-provided prompts and lyrics to a third-party service but does not provide a clear user-facing privacy notice or consent checkpoint at the point of transmission. Because lyrics and prompts may contain sensitive or proprietary text, this can cause unintended data disclosure outside the local environment.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"prompt": prompt
}
response = requests.post(
LYRICS_GENERATION_URL,
json=payload,
headers=self._headers(),
No suspicious patterns detected.