T09 · Insecure Skill Coding Practices
- Location
SKILL.md:45- Finding
Unvalidated and Unquoted User-Controlled Values in Shell Commands
- Content
View full analysis
chief new ``` ```bash git worktree add ../- -b feat/ mkdir -p ../-/.chief/prds/ cp .chief/prds//prd.{md,json} ../-/.chief/prds// ``` ```bash cd ../- git add .chief/prds//prd.md git commit -m "docs: add PRD" ``` ```bash chief ``` ```bash git add .chief/prds//progress.md git commit -m "docs: add progress" git push -u origin feat/ ``` ```bash gh pr create \ --title "feat: " \ --body "Implements the PRD. See .chief/prds//prd.md for spec." \ --base main ``` ```bash cd git worktree remove ../- git branch -d feat/ ``` ### Technical Analysis The workflow instructs an agent to interpolate project names and PRD names directly into shell commands. These values are not validated, consistently quoted, or separated from command options with `--`. A malicious or malformed value containing shell metacharacters can change the structure of the generated command. Relevant characters include command separators such as `;`, command substitutions such as `$()`, redirection operators, whitespace, glob characters, and newline characters. Values beginning with `-` may also be interpreted as command-line options rather than names. The file-system commands additionally accept path components without preventing absolute paths or `..` traversal. Consequently, a crafted project or PRD name may cause operations to target directories outside the intended repository. The cleanup workflow increases the pot ...[truncated 2078 chars]- Remediation
View remediation
