T09 · Insecure Skill Coding Practices
- Location
scripts/fetch-issues.sh:838- Finding
Arbitrary Recursive Deletion Through Unrestricted History Directory Retention
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is mostly a coherent GitHub issue triage helper, but its history cleanup can delete unrelated local directories if pointed at a broad path.
Install only if you are comfortable with local run files being created and pruned. Avoid passing --history-dir as your home directory, a project root, /tmp, or any shared directory; use a dedicated empty state directory for this skill and keep --retain at a conservative value until the cleanup logic is constrained.
scripts/fetch-issues.sh:838Arbitrary Recursive Deletion Through Unrestricted History Directory Retention
The declared description says the skill prioritizes GitHub issues and provides ranked triage recommendations in a read-only manner. The supplied code chunk does not implement prioritization or contributor recommendations; instead, it is a test harness for another script (fetch-issues.sh). Its primary behavior is validating data collection and pipeline mechanics: mocking gh, checking structured error output, excluding issues with linked open PRs, handling --resume and --diff-from, pruning retained run directories, and resetting errors.log. While these behaviors may support a larger issue-triage system and remain read-only with respect to GitHub, the actual code’s purpose is materially different from the declared user-facing capability. Therefore this is a description/behavior mismatch.
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
# ── Step 4: Split into batches (by size, not by count) ───────────────────────
rm -f "$WORKDIR"/batches/batch-*.json "$WORKDIR"/batch-*.json 2>/dev/null || true
if [[ "$REMAINING" -eq 0 ]]; then
NUM_BATCHES=0
The skill instructs the agent to execute shell commands (bash, cat) and use the gh CLI, but it declares no permissions or allowed-tools scope. That creates an implicit capability boundary bypass: a caller may invoke a skill that appears harmless/read-only while it can access the shell and local files, increasing the chance of unintended command execution or data exposure if any inputs are attacker-controlled.
Automatic pruning of workdirs is an unnecessary destructive capability for a fetch/triage helper and expands the blast radius beyond data collection. If HISTORY_DIR is pointed at an unexpected location, the retention loop can delete directories the user did not intend this skill to manage.
The script enforces retention by deleting historical run directories with rm -rf, which contradicts the skill's stated read-only posture. While it does not mutate the GitHub repository, it does perform destructive local filesystem actions that can remove cached analysis artifacts or user data if the history directory is shared or misconfigured.
The script deletes prior run directories without any interactive confirmation, dry-run, or prominent warning. In an agent skill context, silent destructive behavior is more dangerous because callers may assume 'read-only' means no local state will be removed, making accidental data loss harder to notice or prevent.
The header comment describes the script as fetching GitHub issues, detecting linked PRs, and splitting into batches, implying a preparatory/read-oriented tool. Later code silently prunes older run directories, which contradicts that stated intent by adding destructive maintenance behavior not disclosed in the documentation.
No suspicious patterns detected.