T09 · Insecure Skill Coding Practices
- Location
SKILL.md:27- Finding
Shell Command Injection Through Unsafely Interpolated Tool Parameters
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 27-32, 47-55, and 66-69
Vulnerability Type: OS command injection through shell command templates
Risk Level: HighThe skill directly interpolates caller-controlled values into shell commands. Several values are enclosed in double quotes, while
statusandpriorityare not quoted at all.bash /home/david/.cargo/bin/tickrs task list --json \ {{#if project}}--project-name "{{project}}"{{/if}} \ {{#if status}}--status {{status}}{{/if}}bash /home/david/.cargo/bin/tickrs task create --json \ --title "{{title}}" \ {{#if content}}--content "{{content}}"{{/if}} \ {{#if date}}--date "{{date}}"{{/if}} \ {{#if project}}--project-name "{{project}}"{{/if}} \ {{#if priority}}--priority {{priority}}{{/if}}bash /home/david/.cargo/bin/tickrs task complete "{{id}}" --jsonTechnical Analysis
The dynamic parameters
project,status,title,content,date,priority, andidare embedded in command strings without shell-safe argument handling.Double quotes do not provide adequate protection when an attacker can inject a double quote that terminates the intended argument. The attacker may then append shell metacharacters and an arbitrary command. For example, a malicious title shaped like:
text "; arbitrary_command; #can terminate the
--titlevalue, introduce another command, and comment out the remaining generated command. The unquotedstatusandprioritysubstitutions are even more directly exposed to shell separators, expansions, redirections, and substitutions.The documented enum restrictions for
statusandprioritydo not establish that runtime validation is enforced. Therefore, they cannot be relied upon as a security boundary.Attack Path
- An attacker or untrusted caller supplies a crafted value for a tool parameter such as
title,content,project,id, ...[truncated 1526 chars]
- An attacker or untrusted caller supplies a crafted value for a tool parameter such as
- Remediation
View remediation
Remediation Suggestions
-
Do not construct shell command strings with interpolated parameters. Invoke
/home/david/.cargo/bin/tickrsdirectly through an execution API that accepts a program path and an argument array, with shell processing disabled.text executable: /home/david/.cargo/bin/tickrs arguments: ["task", "create", "--json", "--title", title] shell: false -
Append optional flags and their values as separate argument-array elements. Never concatenate user input with flag syntax.
-
Enforce strict allowlists for enumerated fields:
status: onlyincompleteorcompletepriority: onlynone,low,medium, orhigh
-
Validate task IDs against the exact format emitted by
tickrs. Reject values containing whitespace, quotes, control characters, or shell metacharacters. -
Apply reasonable length and character restrictions to project names, titles, content, and dates. Treat these checks as defense in depth rather than a substitute for shell-free execution.
-
If a shell is absolutely unavoidable, use a proven argument-escaping routine for the exact target shell on every dynamic value. Do not implement escaping through simple quote replacement.
-
Add negative tests using quotes, semicolons, command substitutions, newlines, redirections, and backticks to verify that malicious input is passed only as literal data.
-
