T09 · Insecure Skill Coding Practices
- Location
scripts/tts.py:59- Finding
Predictable Temporary File Enables Symlink-Based File Truncation
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill appears to do the claimed TTS and voice-cloning work, but it handles sensitive voice uploads and API keys in ways users should review carefully before installing.
Install only if you trust MOSS Studio with the text and voice samples you provide. Use only voices you own or have explicit permission to clone, avoid sensitive recordings, do not print or share MOSS_API_KEY, prefer a secret manager over shell-profile storage, and consider reviewing the temporary-file handling and dependency pinning before use.
scripts/tts.py:59Predictable Temporary File Enables Symlink-Based File Truncation
requirements.txt:1Unbounded Third-Party Dependency Version Weakens Supply-Chain Integrity
references/troubleshooting.md:5Troubleshooting Guidance Exposes and Persists API Credentials Insecurely
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
# 1. Upload
with open(args.file, "rb") as f:
up_resp = requests.post("https://studio.mosi.cn/api/v1/files",
headers=headers, files={"file": f})
file_id = up_resp.json().get("file_id")
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
# 2. Clone
payload = {"file_id": file_id, "voice_name": args.name}
cl_resp = requests.post("https://studio.mosi.cn/api/v1/voice/clone",
headers=headers, json=payload)
print(cl_resp.text)
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
url = "https://studio.mosi.cn/api/v1/voices?limit=10&status=ACTIVE"
headers = {"Authorization": f"Bearer {api_key}"}
resp = requests.get(url, headers=headers)
voices = resp.json().get("voices", [])
print("| Voice Name | Voice ID | Description |")
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
payload["reference_audio"] = base64.b64encode(f.read()).decode("utf-8")
try:
resp = requests.post(url, json=payload, headers=headers, timeout=60)
data = resp.json()
except Exception as e:
result = {"error": f"API 请求失败: {e}"}
The documented purpose says the skill performs text-to-speech, voice cloning, and audio generation, but the detected behavior suggests it may only enumerate remote voice metadata and not actually perform the claimed actions. This mismatch is dangerous because agents and users may grant sensitive inputs, API keys, or voice samples under false assumptions, enabling unnecessary data exposure and undermining security review.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# 1. 上传音频
curl -X POST https://studio.mosi.cn/api/v1/files/upload \
-H "Authorization: Bearer $MOSS_API_KEY" \
-F "file=@voice.ogg"
# → {"file_id": "YOUR_FILE_ID"}
The skill declares capabilities that imply access to environment secrets, filesystem writes, network access, and shell execution, but it does not define an explicit tool scope such as permissions or allowed-tools. That creates an over-privileged integration surface where an agent may invoke the skill with broader powers than necessary, increasing the blast radius if the skill is misused or later modified.
The trigger conditions are broad enough to activate on generic requests like generating speech or using 'my voice,' which can cause unintended invocation in contexts involving sensitive, impersonation-related, or consent-sensitive requests. In a voice-cloning skill, overbroad triggers are more dangerous because accidental activation may prompt collection or upload of reference audio without sufficiently deliberate user confirmation.
The skill explicitly instructs users to upload audio files to an external service for cloning, which is a real external data transmission of potentially biometric voice data and associated authentication tokens. Although aligned with the skill's purpose, this is security-sensitive because voice samples are personal data and can be misused for impersonation, privacy violations, or retention beyond the user's expectations.
# 1. 上传并克隆
curl -X POST https://studio.mosi.cn/api/v1/files/upload \
-H "Authorization: Bearer $MOSS_API_KEY" \
-F "file=@voice.ogg"
# → {"file_id": "YOUR_FILE_ID"}
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
使用预注册音色:
curl -X POST https://studio.mosi.cn/v1/audio/tts \
-H "Authorization: Bearer $MOSS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
This duplicate finding covers the same real issue: the sample posts reference audio to a remote endpoint for real-time cloning/TTS. Because the skill's purpose includes voice cloning, this transmission is more sensitive than ordinary API traffic and can expose biometric data to third-party processing without adequate safeguards in the guide.
with open("voice.ogg", "rb") as f:
audio_base64 = base64.b64encode(f.read()).decode()
resp = requests.post(
"https://studio.mosi.cn/v1/audio/tts",
headers={"Authorization": f"Bearer {API_KEY}"},
json={
This duplicate finding covers the same real issue: the sample posts reference audio to a remote endpoint for real-time cloning/TTS. Because the skill's purpose includes voice cloning, this transmission is more sensitive than ordinary API traffic and can expose biometric data to third-party processing without adequate safeguards in the guide.
with open("voice.ogg", "rb") as f:
audio_base64 = base64.b64encode(f.read()).decode()
resp = requests.post(
"https://studio.mosi.cn/v1/audio/tts",
headers={"Authorization": f"Bearer {API_KEY}"},
json={
The guide documents uploading voice samples and cloning a voice without any warning about consent, biometric sensitivity, or lawful use. In the context of a voice-cloning skill, this omission is dangerous because users may be encouraged to transmit and reproduce another person's voice without authorization, enabling impersonation, fraud, or privacy violations.
This example invokes the voice-cloning endpoint using a previously uploaded audio file, enabling creation of a reusable synthetic voice from user-provided speech. In this skill context, that is inherently sensitive because it facilitates scalable impersonation if consent, authorization, and abuse-prevention requirements are not clearly documented.
curl -X POST https://studio.mosi.cn/api/v1/voice/clone \
-H "Authorization: Bearer $MOSS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"file_id": "YOUR_FILE_ID", "name": "我的声音"}'
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
MOSS_API_KEY="sk-xxx" python3 -c "
import requests, json
headers = {'Authorization': f'Bearer \$MOSS_API_KEY', 'Content-Type': 'application/json'}
resp = requests.post('https://studio.mosi.cn/v1/audio/tts',
headers=headers,
json={'model': 'moss-tts', 'text': 'test'},
timeout=10)
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
MOSS_API_KEY="sk-xxx" python3 -c "
import requests, json
headers = {'Authorization': f'Bearer \$MOSS_API_KEY', 'Content-Type': 'application/json'}
resp = requests.post('https://studio.mosi.cn/v1/audio/tts',
headers=headers,
json={'model': 'moss-tts', 'text': 'test'},
timeout=10)
This markdown file uses Chinese throughout, including headings, instructions, and examples, and does not indicate that the skill is region-specific or that users may choose another language. Under the policy for natural-language violations, forcing a specific language without user opt-in is reportable.
The troubleshooting step explicitly instructs users to print the API key with echo $MOSS_API_KEY, which can expose the credential on-screen, in terminal scrollback, screen recordings, shared sessions, or support screenshots. In a skill that handles paid API access and voice-cloning operations, leaking the bearer token could allow unauthorized use of the service and abuse of the account.
The document tells users to append a plaintext API key export directly into ~/.zshrc, creating long-term credential storage in a shell startup file that may be backed up, synced, or read by other local tooling. This increases the persistence and exposure window of a sensitive bearer token without discussing safer secret-management options.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
headers = {"Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json"}
# 测试 TTS
resp = requests.post(
"https://studio.mosi.cn/v1/audio/tts",
headers=headers,
json={"model": "moss-tts", "text": "测试", "voice_id": "YOUR_VOICE_ID"},
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
headers = {"Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json"}
# 测试 TTS
resp = requests.post(
"https://studio.mosi.cn/v1/audio/tts",
headers=headers,
json={"model": "moss-tts", "text": "测试", "voice_id": "YOUR_VOICE_ID"},
The script uploads an arbitrary user-supplied local file to a third-party remote API with no in-code consent prompt, disclosure, or validation of what is being sent. In a voice-cloning skill, this is especially sensitive because audio samples may contain biometric voice data, creating privacy, compliance, and inadvertent data-sharing risks.
This code performs external transmission of a local file to a third-party service. In the context of a voice-cloning tool, the transmitted content is likely sensitive biometric audio, so outbound transfer is materially security-relevant and should not occur silently.
# 1. Upload
with open(args.file, "rb") as f:
up_resp = requests.post("https://studio.mosi.cn/api/v1/files",
headers=headers, files={"file": f})
file_id = up_resp.json().get("file_id")
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# 2. Clone
payload = {"file_id": file_id, "voice_name": args.name}
cl_resp = requests.post("https://studio.mosi.cn/api/v1/voice/clone",
headers=headers, json=payload)
print(cl_resp.text)
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# 2. Clone
payload = {"file_id": file_id, "voice_name": args.name}
cl_resp = requests.post("https://studio.mosi.cn/api/v1/voice/clone",
headers=headers, json=payload)
print(cl_resp.text)
No suspicious patterns detected.