T09 · Insecure Skill Coding Practices
- Location
SKILL.md:38- Finding
Unsafe Shell and JSON Interpolation of User-Controlled Values
- Content
View full analysis
\", \"provider\": \"sensesong\"}") ``` Lines 94–104: ```bash SONG_RESP=$(curl -s -X POST "https://api.senseaudio.cn/v1/song/music/create" \ -H "Authorization: Bearer $SENSEAUDIO_API_KEY" \ -H "Content-Type: application/json" \ -d "{ \"model\": \"sensesong\", \"lyrics\": \"\", \"title\": \"\", \"vocal_gender\": \"<f|m>\", \"style\": \"<STYLE>\" }") SONG_TASK=$(echo $SONG_RESP | jq -r '.task_id') ``` ### Technical Analysis The documented commands place the user-controlled prompt, lyrics, title, and style directly inside double-quoted shell arguments. The Skill does not instruct the agent to pass these values through environment variables or serialize them using a JSON-aware mechanism. If an agent implements the examples through literal placeholder substitution, shell metacharacters contained in user input can terminate the intended quoting context. Command substitutions, quotation marks, backslashes, semicolons, or newlines could then alter the command evaluated by the shell. Even when command execution is not achieved, unescaped quotation marks and control characters can corrupt the JSON request. The problem affects both lyric generation and song generation. Lyrics returned by the remote service are also placed into the second command as `<LYRICS>`, so unsafe data does not necessarily have to originate directly from the user. ### Attack Path 1. An attacker submits a song prompt, title, lyrics, or style containing shell syntax designed to escape the JSON string and shell quoti ...[truncated 1299 chars]- Remediation
View remediation
