T09 · Insecure Skill Coding Practices
- Location
SKILL.md:134- Finding
Unsafe interpolation of user-controlled and API-controlled values into shell commands
- Content
View full analysis
", "model_id": "0-41", "options": { "prompt_optimization": true, "resolution": "1K", "aspect_ratio": "1:1" } }' ``` Task-status polling: ```bash curl -s -X POST https://api.pixwith.ai/api/task/get \ -H "Content-Type: application/json" \ -H "Api-Key: $PIXWITH_API_KEY" \ -d '{"task_id": ""}' ``` Image-to-image task creation: ```bash curl -s -X POST https://api.pixwith.ai/api/task/create \ -H "Content-Type: application/json" \ -H "Api-Key: $PIXWITH_API_KEY" \ -d '{ "prompt": "", "image_urls": ["", ""], "model_id": "0-41", "options": { "prompt_optimization": true, "resolution": "1K", "aspect_ratio": "0" } }' ``` ### Technical Analysis The documented command templates place dynamic values such as the user prompt, edit instruction, image URLs, and API-returned task identifier inside single-quoted shell arguments. If an agent implements the instructions by directly replacing the placeholders before executing the command, an attacker-controlled single quote can terminate the shell-quoted JSON string. Subsequent shell metacharacters can then introduce an additional command. JSON escaping is not sufficient to prevent this issue because JSON and the shell have separate parsing contexts. A value must first be serialized safely as JSON and must then be passed to the shell without being reinterpreted as executable syntax. The task identifier is returned by the external API ...[truncated 2237 chars]- Remediation
View remediation
