T09 · Insecure Skill Coding Practices
- Location
SKILL.md:43- Finding
Shell Command Injection Through Interpolated Vision-Generated JSON
- Content
View full analysis
' | python3 scripts/tracker.py estimate` 6. Reply with formatted summary noting it's an **estimate** (≈) ``` ### Technical Analysis The documented workflow instructs the agent to insert JSON derived from a vision model into a single-quoted shell command: ```sh echo '' | python3 scripts/tracker.py estimate ``` JSON strings may legitimately contain apostrophes. If the placeholder is replaced through direct string interpolation, an apostrophe terminates the shell's single-quoted argument. Subsequent shell metacharacters in the generated content can then be interpreted as commands rather than data. The input is influenced by an image supplied by a user and by the response of a remote vision model. Consequently, neither the field values nor their shell safety can be assumed. Although `tracker.py estimate` safely reads JSON from standard input, the injection occurs in the shell before the Python process parses that input. For example, a model-generated item value containing a payload structurally similar to the following could break out of the quoted argument when interpolated: ```text '; attacker_command; echo ' ``` Whether a particular payload succeeds depends on how the host agent materializes the documented command. The unsafe command pattern nevertheless establishes an exploitable injection boundary when ordinary shell substitution is used. ### Attack Path 1. An attacker submits an image containing adversarial text or visual prompt-injection content. 2. The image is sent to the platform image tool as direct ...[truncated 1118 chars]- Remediation
View remediation
