T09 · Insecure Skill Coding Practices
- Location
SKILL.md:112- Finding
Unsafe interpolation of user-controlled search terms into shell and JSON commands
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:112-119andSKILL.md:180-187
Vulnerability Type: Shell command injection through unsafe string interpolation
Risk Level: HighVulnerable Code
bash # By keyword curl -s -X POST https://api.comulytic.ai/mcp \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $COMULYTIC_MCP_TOKEN" \ -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"meetings/search","arguments":{"query":"KEYWORD","limit":5}}}' \ | jq '.result.content[0].text' -r | jq '.'A second instance uses the same unsafe pattern:
bash curl -s -X POST https://api.comulytic.ai/mcp \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $COMULYTIC_MCP_TOKEN" \ -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"conversations/search","arguments":{"query":"KEYWORD","limit":10}}}' \ | jq '.result.content[0].text' -r | jq '.'Technical Analysis
The documented command embeds the
KEYWORDplaceholder inside a single-quoted shell argument containing JSON. The Skill does not instruct the agent to encode the search term with a JSON serializer or pass it through a safe positional parameter.If an agent implements the example by directly replacing
KEYWORDwith user-controlled text, a search term containing a single quote can terminate the shell-quoted JSON argument. Shell metacharacters following that quote can then be interpreted as commands rather than data. Ordinary quotes and control characters can also corrupt the JSON request even when they do not produce command execution.This is especially sensitive because the same shell process holds
COMULYTIC_MCP_TOKEN, which authorizes access to private meeting summaries, transcripts, contacts, action items, and conversation history.Attack Path
- An attacker supplies a meeting or conversation search term containing a single quote followed by shell s ...[truncated 1330 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not interpolate user-controlled values into shell source text.
- Generate the complete request body with a JSON-aware tool such as Python or
jq. - Pass the search term as a positional argument or environment value rather than embedding it in shell syntax.
- Use
curl --data-binarywith serialized data supplied through standard input. - Add explicit instructions that agents must treat meeting IDs, contact IDs, keywords, dates, cursors, and other API arguments as data.
A safer pattern using
jqis:bash payload="$(jq -n --arg query "$QUERY" '{ jsonrpc: "2.0", id: 1, method: "tools/call", params: { name: "meetings/search", arguments: {query: $query, limit: 5} } }')" curl -sS -X POST https://api.comulytic.ai/mcp \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $COMULYTIC_MCP_TOKEN" \ --data-binary "$payload"Prefer implementing the API call in a dedicated script that accepts structured arguments and serializes them with Python's
jsonmodule, avoiding dynamically assembled shell commands entirely.
