T09 · Insecure Skill Coding Practices
- Location
refs/execution-loop.md:28- Finding
Automatic destructive Git rollback can erase unrelated user changes
- Content
View full analysis
Vulnerability Details
File Location:
refs/execution-loop.md:15, 28;SKILL.md:17-22;tool/tool-config.json:18-20
Vulnerability Type: Unsafe destructive rollback
Risk Level: HighVulnerable Code Snippets
refs/execution-loop.md:15:md - **Action**: Use code discovery tools to find entry points, dependencies, and validation scripts. Run `git status` to ensure you aren't stepping on uncommitted work. - **Output**: The minimum working map and rollback plan (e.g., `git reset --hard`).refs/execution-loop.md:28:md - **Action**: Run test commands or manually verify the criteria. If tests fail and you are stuck, you MUST auto-rollback using `git checkout -- <files>` or `git reset --hard`, and return to Phase 2.SKILL.md:17-22:yaml - Bash(git status:*) - Bash(git diff:*) - Bash(git checkout:*) - Bash(git add:*) - Bash(git commit:*) - Bash(git reset:*)tool/tool-config.json:18-20:json "change": { "title": "Smallest Change", "tools": ["Edit", "MultiEdit", "Write", "Bash(git checkout:*)", "Bash(git reset:*)"] },Technical Analysis
The Skill explicitly requires automatic rollback with
git reset --hardwhen validation fails. This command resets the index and tracked working tree across the repository, rather than reverting only changes created by the Agent.Although the workflow performs
git statusduring the mapping phase, it does not require another repository-state check immediately before rollback. It also does not record ownership of individual changes, preserve a patch, create an approved backup, or request user authorization before executing the destructive operation. Changes introduced by the user, another process, or another Agent after the initial status check can therefore be destroyed.The wildcard permission
Bash(git reset:*)also permits reset variants and targets beyond the minimum capability needed to ...[truncated 1381 chars]- Remediation
View remediation
Remediation Suggestions
- Remove
Bash(git reset:*)from bothSKILL.mdandtool/tool-config.json. - Eliminate the requirement to perform automatic destructive rollback.
- Record the exact files and patches produced by the Agent during implementation.
- Revert only Agent-owned changes, using a reviewed inverse patch or explicit file-scoped restoration.
- Run
git statusandgit diffimmediately before any rollback and compare the result with the recorded pre-change state. - Stop and request explicit user approval if unrelated or ambiguous changes are present.
- Before an approved destructive operation, preserve recoverable state through a patch or another user-approved backup mechanism.
- Prefer remediation of a failed test over rollback; if neither is safe, report the failure without altering unrelated work.
- Remove
