T09 · Insecure Skill Coding Practices
- Location
references/examples.md:469- Finding
Shell Command Injection Through Unvalidated Project Paths and Task IDs
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is for coordinated software work, but it asks agents to run broad Git, package-install, subagent, and cleanup operations with weak safeguards.
Use this only in dedicated, backed-up repositories and preferably in a sandbox. Before allowing it to run, require explicit approval for package installation, pushes to remotes, hard resets, and deletion; review staged diffs and remotes; validate worktree paths; and avoid exposing credentials or sensitive untracked files.
references/examples.md:469Shell Command Injection Through Unvalidated Project Paths and Task IDs
references/examples.md:12Automatic Execution of Untrusted Repository Build and Dependency Installation Logic
SKILL.md:61Unreviewed Git Publication and Destructive Workspace Operations
git reset --hard origin/main forcibly discards local changes, including uncommitted work, and can destroy engineer state if run in the wrong repository or at the wrong time. Because the skill presents this as a standard synchronization step for agents, it increases the chance of automated data loss and unsafe use without safeguards.
cd ../workspace-engineer-1 git fetch origin git reset --hard origin/main # Sync worktree to latest main
**Worktree cleanup (after completion or limit reached):**
rm -rf ../workspace-engineer-1 is a high-risk destructive command because a relative path can resolve unexpectedly depending on the current working directory, and recursive forced deletion is irreversible. In a multi-agent automation skill, an agent may execute this literally or with substituted parameters, turning documentation into a dangerous operational primitive that can wipe unrelated files.
# Remove worktree when engineer finishes or hits iteration limit
git worktree remove ../workspace-engineer-1
rm -rf ../workspace-engineer-1 # Clean up directory
Worktrees are deleted after all assigned tasks are completed or when the engineer reaches the predefined iteration limit.
This second occurrence of git reset --hard origin/main repeats the same unsafe destructive sync pattern and normalizes hard resets as routine behavior. In the context of a skill meant to coordinate multiple agents and worktrees, repeated destructive examples make accidental or automated loss of code more likely.
cd ../workspace-engineer-1 git fetch origin git reset --hard origin/main # Or rebase
This ensures engineers work from latest integrated state.
Referenced artifact was not completely inspected
See [references/examples.md](references/examples.md) for concrete implementation examples including:
rm -rf ../workspace-engineer-1 is a high-risk deletion primitive embedded in instructions for autonomous workflow execution. If the path is malformed, symlinked, reused, or derived unsafely in future adaptations, the agent could recursively delete unintended directories with no recovery path.
git worktree remove ../workspace-engineer-1
# 2. Clean up directory
rm -rf ../workspace-engineer-1
# 3. Verify worktree list
git worktree list
git reset --hard origin/main is a destructive repository-state command that can erase local modifications and branch history from the working copy. In this skill, the command is presented as a normal state synchronization step for engineers, making accidental destructive use more likely in automated or semi-automated runs.
# Sync to latest main
git fetch origin
git reset --hard origin/main # OR: git rebase origin/main
# Verify sync worked
git log --oneline -3
The skill documents destructive cleanup steps (git worktree remove followed by rm -rf) without requiring path validation, confirmation, or an explicit warning about data loss. In an agent-executed workflow, these commands could delete unintended directories or uncommitted work if workspace paths are wrong, symlinked, or reused, making the guidance operationally unsafe.
The example documents worktree cleanup using destructive filesystem operations without any warning, path validation, or safer alternatives. In an agent skill context, this is risky because an automated agent may execute the commands verbatim in the wrong directory or against an unexpected path, causing irreversible data loss.
The documented synchronization flow includes git reset --hard origin/main without warning that it discards uncommitted and divergent local changes. In an automation setting, an agent could apply this blindly and destroy work product or overwrite investigation artifacts.