T09 · Insecure Skill Coding Practices
- Location
SKILL.md:13- Finding
Shell Command Injection Through Unvalidated Smart-Home Targets
- Content
View full analysis
/`. - Targets use `Room/Device` format or just `DeviceName` - Spaces → `%20` in URLs ``` `references/api.md:3-5`: ```markdown Base URL: `http://localhost:8423` (default port, configurable in Settings) All endpoints respond with JSON. Targets are case-insensitive. Use `%20` for spaces. ``` `references/api.md:127-131`: ```markdown ## Target Format - `Room/Device` → most specific, preferred - `DeviceName` → matches across all rooms (may be ambiguous) - `RoomName` → matches all devices in room (for info/list only) - URL encode spaces: `Living Room` → `Living%20Room` ``` ### Technical Analysis The Skill directs the agent to interpolate an action and target into a shell command containing a URL. The only documented encoding requirement is replacement of spaces with `%20`. It does not require full URL path-segment encoding, validation of target characters, action allowlisting, or shell-safe argument handling. Room, device, group, and scene names may derive from user requests or local smart-home metadata. If an agent builds the documented command as a shell string, metacharacters such as semicolons, command substitutions, redirection operators, or shell control operators can be interpreted by the shell rather than treated as part of the target. Quoting a dynamically assembled URL is not a complete defense when the implementation constructs a command string and evaluates it through a shell. Command substitution and incorrect escaping can remain exploitable depending on how interpolation occurs. The safe approach is to avoid shell parsing entirely. ### Attack Path 1. ...[truncated 1568 chars]- Remediation
View remediation
