T09 · Insecure Skill Coding Practices
- Location
SKILL.md:31- Finding
Unvalidated and Unquoted Shell Command Placeholders
- Content
View full analysis
--repo --json number,title,body,author,baseRefName,headRefName,changedFiles,additions,deletions,labels,isDraft,mergeable > pr.json ``` 2. Collect status checks: ```bash gh pr checks --repo --json bucket,name,state,workflow > checks.json ``` ``` ### Technical Analysis The documented commands instruct the Agent to interpolate a pull-request number and repository identifier directly into shell commands. Neither placeholder is quoted, and the instructions do not require validation before command execution. If these values are copied from an untrusted user request, shell metacharacters embedded in either value can alter the command structure. Characters and constructs such as semicolons, command substitutions, pipelines, and redirections could cause additional commands to run under the privileges of the Agent process. The fixed output redirections to `pr.json` and `checks.json` are not themselves attacker-controlled. The weakness is the absence of a strict input contract and safe argument-passing mechanism for the interpolated values. ### Attack Path 1. An attacker requests a review using a repository identifier or pull-request value containing shell syntax. 2. The Agent substitutes that value into one of the commands documented in `SKILL.md`. 3. The Agent invokes the command through a shell without quoting or validating the substituted value. 4. The shell interprets the injected metacharacters rather than treating the entire value as a single `gh` argument. 5. An attacker-selected command executes with the same operating-system privileges and environment access as the Agent. Successful exploitation depends on the calling Agent perfo ...[truncated 767 chars]- Remediation
View remediation
