T09 · Insecure Skill Coding Practices
- Location
SKILL.md:40- Finding
Shell Command Injection Through Unquoted URL and Destination Parameters
- Content
View full analysis
", background=true, timeout=600 ) ``` Other affected command patterns include: ```bash curl -L -C - --progress-bar -o file.zip curl -L --retry 3 --connect-timeout 30 -o file.zip aria2c -x 16 -s 16 -k 1M --continue -o ~/Downloads/file.zip curl -I curl -v -o /dev/null wget --continue ``` ### Technical Analysis The skill directs the agent to interpolate user-controlled URL and destination values directly into shell command strings. Neither value is quoted, escaped, validated, nor passed through a shell-free argument API. Shell metacharacters such as `;`, `&&`, `|`, command substitutions, redirections, and newlines can consequently alter the intended command. URL syntax alone does not make a value safe for shell interpolation. The destination parameter presents the same problem and can also be abused to inject options or additional commands. Because these commands execute through the agent's `exec` facility, successful exploitation runs injected commands with all operating-system privileges available to the agent process. ### Attack Path 1. An attacker asks the agent to download a file and supplies a maliciously formed URL or destination. 2. For example, the URL contains a shell command separator followed by an attacker-selected command. 3. The agent substitutes the value into the documented `command="curl ... "` template. 4. The execution tool passes the resulting string to a shell. 5. The shell executes the legitimate downloader command and then the injected command. 6. The injected process can access files, credentials, network r ...[truncated 541 chars]- Remediation
View remediation
