T09 · Insecure Skill Coding Practices
- Location
SKILL.md:87- Finding
Predictable Temporary Storage and Unsanitized Run Identifier
- Content
View full analysis
/ ├── case-input.md # Original problem statement and constraints ├── team-roster.md # Selected CEO and specialists with rationale ├── handoffs/ # One file per specialist │ ├── .md │ └── ... ├── reports/ # Expert reports (one per specialist) │ ├── .md │ └── ... ├── challenges.md # CEO challenges and expert responses ├── verification.md # Verification verdicts (PASS/FAIL/PARTIAL) └── final-synthesis.md # CEO synthesis and recommendations ``` ```bash RUN_ID="${RUN_ID:-run-$(date +%Y%m%d-%H%M%S)}" RUN_DIR="/tmp/ai-expert-team/runs/$RUN_ID" mkdir -p "$RUN_DIR/handoffs" "$RUN_DIR/reports" ``` ### Technical Analysis The caller-controlled `RUN_ID` is directly appended to a filesystem path without character validation, canonicalization, or a check that the resulting path remains beneath `/tmp/ai-expert-team/runs`. Shell quoting prevents shell metacharacter injection, but it does not prevent filesystem traversal. A value containing path separators or `..` components can cause `RUN_DIR` to resolve outside the intended run namespace. For example, a run identifier such as `../../target` would produce a path lexically located under the runs directory but resolving elsewhere after path normalization. The Skill also uses a predictable shared directory under `/tmp` without requiring: - A private `0700` parent directory. - `0600` permissions for generated files. - Exclusive directory creation. - Rejection of pre-existing files or symbolic links. - A collision- ...[truncated 2090 chars]- Remediation
View remediation
