T09 · Insecure Skill Coding Practices
- Location
SKILL.md:57- Finding
Potential Shell Command Injection Through Unsafe User-Controlled JSON Interpolation
- Content
View full analysis
/dev/null | jq -r '.profiles[.defaultProfile].apiKey' 2>/dev/null)}" && \ curl -s -X POST "https://oatda.com/api/v1/llm/image" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $OATDA_API_KEY" \ -d '{ "provider": "", "model": "", "contents": [ {"type": "text", "text": ""}, {"type": "image", "image": {"url": "", "detail": "auto"}} ] }' ``` The same unsafe construction pattern is repeated in the example at `SKILL.md`, lines 117–129. ### Technical Analysis The documented command places the request body inside a single-quoted shell argument while instructing the Agent to substitute values such as `` and ``. These values may originate from user input, but the Skill does not require them to be encoded with a JSON serializer or passed through a shell-safe mechanism. If an implementation performs direct textual substitution, a single quote in an attacker-controlled value can terminate the shell argument. The remaining input can then be interpreted as shell syntax. Even where shell execution is not achieved, unescaped double quotes, backslashes, control characters, or newlines can alter the JSON structure or produce an invalid request. This is particularly sensitive because the same shell process exports `OATDA_API_KEY`. Successful injected commands would execute in an environment containing that credential and with the privileges of the Agent process. Access to `OATDA_API_KEY` and the fallback credential file `~/.oatda/credentials.json` is functionally justified for authentication to the declared OATDA API. No unrelated credential destination was ...[truncated 1743 chars]- Remediation
View remediation
