T09 · Insecure Skill Coding Practices
- Location
SKILL.md:97- Finding
Unquoted Window Search Input May Enable Shell Command Injection
- Content
View full analysis
OverRec.exe cli window --all # also shows monitor, location, size ``` The unsafe pattern is repeated in the window-placement workflow: ```bash # 1. Find the window OverRec.exe cli window # 2. Snap it (use the WindowID from step 1) OverRec.exe cli snap --windowid ID --location X,Y --size WxH # 3. Optionally draw a brief overlay to confirm placement OverRec.exe cli draw --location X,Y --size WxH --timeout 2 ``` ### Technical Analysis The Skill instructs the Agent to replace `` with a window-title keyword supplied through a user request and then execute the resulting Bash command. The substituted value is not explicitly quoted, validated, or passed through a structured process-execution interface. If the Agent performs direct textual substitution, shell metacharacters in the keyword—including command separators, pipelines, command substitutions, or redirection operators—can be interpreted by Bash rather than passed to `OverRec.exe` as literal window-title text. Quoting only some fixed arguments elsewhere in the document does not protect these unquoted search commands. This weakness is especially relevant because the Skill declares Bash as an allowed tool and explicitly directs the Agent to execute the illustrated commands. ### Attack Path 1. An attacker asks the Agent to find, move, or resize a window. 2. The attacker supplies a crafted “window title” containing shell syntax, such as a title followed by a command separator and an additional local command. 3. The Agent substitutes the supplied text directly for ``. 4. Bash parses the shell syntax instead of treating the complete value as one literal search argument. 5. The injected command executes with the same ...[truncated 984 chars]- Remediation
View remediation
` to state explicitly that direct textual substitution is prohibited. 7. When multiple title words are supported, construct a safely quoted argument array instead of splitting an untrusted string through shell evaluation. 8. Add negative tests covering semicolons, pipelines, command substitutions, redirections, newlines, quotes, and leading hyphens to verify that each value reaches OverRec only as literal data. ]]>
