T09 · Insecure Skill Coding Practices
- Location
SKILL.md:61- Finding
Command Injection Through Unsafe Search Query Interpolation
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 61–62
Vulnerability Type: Shell command injection through user-controlled input
Risk Level: Mediumbash curl -X GET "https://api.voicenotes.com/api/integrations/open-claw/search/semantic?query={search_query}" \ -H "Authorization: $VOICENOTES_API_KEY"Technical Analysis
The primary semantic-search example instructs the agent to insert a user-supplied search query directly into a quoted shell command. If implemented through textual substitution, a query containing a double quote followed by shell syntax can terminate the URL argument and introduce an additional command.
The query is also not URL-encoded, so reserved characters may alter the request or produce malformed URLs. Although lines 247–255 later require
--data-urlencodeand provide a safer example, the earlier executable example conflicts with that requirement and may be followed independently.Attack Path
- An attacker supplies a search query containing a closing quote and shell metacharacters.
- The agent replaces
{search_query}in the documented command without applying the later encoding requirement. - The injected quote terminates the URL argument.
- The shell interprets the remaining attacker-controlled text as command syntax.
- The injected command executes with the same operating-system privileges and environment access as the agent process.
Impact Assessment
Successful exploitation could allow arbitrary local command execution under the agent's account. This may permit access to files and environment variables available to that account, including
VOICENOTES_API_KEY, and could cause unintended network requests or data disclosure. The issue does not independently provide elevated system privileges beyond those already held by the agent.- Remediation
View remediation
Remediation Suggestions
Replace the unsafe example with the safe parameter-encoding form and remove all conflicting examples:
bash curl -G "https://api.voicenotes.com/api/integrations/open-claw/search/semantic" \ --data-urlencode "query=$SEARCH_QUERY" \ -H "Authorization: $VOICENOTES_API_KEY"Treat user input as data rather than shell source. Pass arguments directly to a process-execution API without invoking a shell where possible. If a shell is unavoidable, keep the value in a quoted variable and use
--data-urlencode; do not construct the complete command through textual interpolation. Add tests covering quotes, command separators, substitutions, newlines, and URL-reserved characters.
