T09 · Insecure Skill Coding Practices
- Location
SKILL.md:39- Finding
Shell and Request Injection Through Unvalidated Template Substitution
- Content
View full analysis
/dev/null ``` Project conversion request: ```bash curl -s -X POST "{CLAWMATE_URL}/api/clawmate/project/convert" \ -H 'Content-Type: application/json' \ -d '{"root":"{root}","path":"{project_name}"}' 2>/dev/null ``` Feedback-processing request: ```bash curl -s -X POST "{CLAWMATE_URL}/api/clawmate/task/run" -H 'Content-Type: application/json' -d '{"root":"","file":"","selections":[{"task_id":"review_modify","content":"","note":""}]}' 2>/dev/null ``` Configuration retrieval and parsing: ```bash curl -s "{CLAWMATE_URL}/api/clawmate/config" 2>/dev/null | python3 -c " import json, sys cfg = json.load(sys.stdin) for root in cfg['roots']: print(f\"{root['id']}|{root['dir']}\") " ``` Project-list retrieval and parsing: ```bash curl -s "{CLAWMATE_URL}/api/clawmate/list?root=&marker_filter=true" 2>/dev/null | python3 -c " import json, sys data = json.load(sys.stdin) for e in data.get('entries', []): if e.get('is_dir') and not e['name'].startswith('.'): print(e['name']) " ``` ### Technical Analysis The Skill instructs the agent to construct shell commands by directly substituting values such as `CLAWMATE_URL`, search keywords, root identifiers, project names, file paths, selected content, and feedback notes into shell, URL, and JSON contexts. No mandatory validation, shell-safe argument handling, URL encoding, or JSON serialization is specified. These values cross several parsing boundaries: 1. The shell parses the generated c ...[truncated 2551 chars]- Remediation
View remediation
/dev/null`; return sanitized failures so malformed or redirected requests are visible. 9. Add tests covering quotation marks, apostrophes, command substitutions, semicolons, newlines, Unicode delimiters, traversal sequences, and malformed URLs. ]]>
