T09 · Insecure Skill Coding Practices
- Location
SKILL.md:20- Finding
Hardcoded Shared API Credential
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a coherent speech-generation tool, but it needs review because it enables voice cloning and external voice-message delivery without enough consent and recipient safeguards.
Install only if you are comfortable sending source text, files, URLs, and reference voice samples to the Xiaomi speech service. Use voice cloning only for your own voice or voices you are authorized to use, and verify any Feishu CHAT_ID/token setup before asking it to send audio to a chat.
SKILL.md:20Hardcoded Shared API Credential
The skill prominently supports voice cloning and mimicry but provides no consent, authorization, or privacy safeguards for using reference audio. In context, this is especially dangerous because the core feature is impersonation-capable synthesis, which can enable fraud, harassment, or deceptive communications using someone else's voice.
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
OUTPUT=output_$(date +%s).wav
curl -X POST "$BASE/v1/audio/generate" \
-H "Authorization: Bearer $API_KEY" \
-F "source_type=text" \
-F "text=内容" \
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
echo "已提交: $JOB"
for i in $(seq 1 60); do
STATUS=$(curl -s -H "Authorization: Bearer $API_KEY" \
"$BASE/v1/audio/jobs/$JOB" \
| python3 -c "import sys,json; print(json.load(sys.stdin)['status'])")
[ "$STATUS" = "done" ] && break
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
done [ "$STATUS" != "done" ] && echo "轮询超时" && exit 1
curl -s -H "Authorization: Bearer $API_KEY"
"$BASE/v1/audio/jobs/$JOB/download" --output "$OUTPUT"
echo "✓ 保存至 $OUTPUT"
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
done [ "$STATUS" != "done" ] && echo "轮询超时" && exit 1
curl -s -H "Authorization: Bearer $API_KEY"
"$BASE/v1/audio/jobs/$JOB/download" --output "$OUTPUT"
echo "✓ 保存至 $OUTPUT"
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
| `req_id` | synthesize | 来自 think 返回值 |
| `script_lines_json` | synthesize | 可选,编辑后脚本 `[{"speaker":"..","text":".."},...]` |
> 降噪预览(不合成,仅试听降噪效果):`curl -X POST "$BASE/v1/audio/vp/denoise" -H "Authorization: Bearer $API_KEY" -F "voice_file=@ref.webm" --output denoised.wav`。当前返回标准 WAV,采样率为 48kHz。
### VP 模板(预置脚本,不需要输入文本)
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
| `req_id` | synthesize | 来自 think 返回值 |
| `script_lines_json` | synthesize | 可选,编辑后脚本 `[{"speaker":"..","text":".."},...]` |
> 降噪预览(不合成,仅试听降噪效果):`curl -X POST "$BASE/v1/audio/vp/denoise" -H "Authorization: Bearer $API_KEY" -F "voice_file=@ref.webm" --output denoised.wav`。当前返回标准 WAV,采样率为 48kHz。
### VP 模板(预置脚本,不需要输入文本)
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
# 返回 req_id / speakers / summary / sentence_count / script_lines
TITLE="罗永浩、王自如的世纪骂战"
ENCODED=$(python3 -c "import sys,urllib.parse; print(urllib.parse.quote(sys.argv[1]))" "$TITLE")
PREP=$(curl -s -X POST "$BASE/v1/audio/vp/templates/$ENCODED/prepare" \
-H "Authorization: Bearer $API_KEY")
REQ_ID=$(echo "$PREP" | python3 -c "import sys,json; print(json.load(sys.stdin)['req_id'])")
echo "$PREP" | python3 -c "import sys,json; d=json.load(sys.stdin); print('speakers:', d['speakers'])"
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
前置:FEISHU_TENANT_TOKEN(或 APP_ID + APP_SECRET)、CHAT_ID、可选 ffmpeg/ffprobe。
[ -z "$FEISHU_TENANT_TOKEN" ] && FEISHU_TENANT_TOKEN=$(curl -s -X POST \
"https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal" \
-H "Content-Type: application/json" \
-d "{\"app_id\":\"$APP_ID\",\"app_secret\":\"$APP_SECRET\"}" \
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
| python3 -c "import sys,json; print(json.load(sys.stdin)['tenant_access_token'])")
ffmpeg -y -i "$OUTPUT" -c:a libopus -b:a 32k output.opus 2>/dev/null && UPLOAD=output.opus || UPLOAD="$OUTPUT"
DURATION_MS=$(ffprobe -v quiet -show_entries format=duration -of csv=p=0 "$OUTPUT" | awk '{printf "%d",$1*1000}')
FILE_KEY=$(curl -s -X POST "https://open.feishu.cn/open-apis/im/v1/files" \
-H "Authorization: Bearer $FEISHU_TENANT_TOKEN" \
-F "file=@$UPLOAD" -F "file_type=opus" -F "file_name=tts.opus" -F "duration=$DURATION_MS" \
| python3 -c "import sys,json; print(json.load(sys.stdin)['data']['file_key'])")
The trigger phrases are extremely broad and include generic requests like read aloud, generate audio, narrate, make it listenable, and send as voice. Overbroad invocation can cause the skill to activate unintentionally in contexts involving sensitive text or audio, increasing the chance of unwanted transmission to external services.
The skill extends beyond speech generation into Feishu delivery and credential handling, including obtaining a tenant token and sending messages/files to a chat. This broadens the trust boundary and creates an additional exfiltration path for generated audio and associated content if invoked improperly or with misconfigured environment variables.
This code sends app credentials to Feishu to obtain a tenant token, introducing external credential transmission beyond the primary TTS service. While expected for Feishu integration, it still increases exposure because secrets are used in shell commands and outbound network calls within the skill workflow.
前置:FEISHU_TENANT_TOKEN(或 APP_ID + APP_SECRET)、CHAT_ID、可选 ffmpeg/ffprobe。
[ -z "$FEISHU_TENANT_TOKEN" ] && FEISHU_TENANT_TOKEN=$(curl -s -X POST \
"https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal" \
-H "Content-Type: application/json" \
-d "{\"app_id\":\"$APP_ID\",\"app_secret\":\"$APP_SECRET\"}" \
The skill can transmit generated audio to an external Feishu chat, which is an outbound data transfer path. If triggered accidentally or with the wrong CHAT_ID, sensitive generated content could be delivered to unintended recipients outside the original execution context.
-H "Authorization: Bearer $FEISHU_TENANT_TOKEN"
-F "file=@$UPLOAD" -F "file_type=opus" -F "file_name=tts.opus" -F "duration=$DURATION_MS"
| python3 -c "import sys,json; print(json.load(sys.stdin)['data']['file_key'])")
curl -s -X POST "https://open.feishu.cn/open-apis/im/v1/messages?receive_id_type=chat_id"
-H "Authorization: Bearer $FEISHU_TENANT_TOKEN" -H "Content-Type: application/json"
-d "{"receive_id":"$CHAT_ID","msg_type":"audio","content":"{\"file_key\":\"$FILE_KEY\"}"}"
No suspicious patterns detected.