T09 · Insecure Skill Coding Practices
- Location
SKILL.md:341- Finding
Destructive Repository-Wide Recovery Command Can Discard Unrelated Work
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:341
Vulnerability Type: Unsafe destructive recovery operation
Risk Level: Mediumbash git checkout -- .Technical Analysis
The post-incident recovery guidance recommends running
git checkout -- .. This command restores every tracked file beneath the current directory to its index state, irreversibly discarding uncommitted modifications unless they were backed up separately.The operation is not restricted to files modified by the suspect Skill. It also lacks prerequisite safeguards such as reviewing
git statusandgit diff, preserving changes, obtaining explicit user confirmation, and verifying the repository root. An AI agent following this Markdown instruction could therefore modify a much broader scope than required for uninstalling or recovering from a malicious Skill.Attack Path
- A repository contains legitimate, uncommitted changes unrelated to the suspect Skill.
- A user or agent follows the documented post-incident recovery procedure.
- The command is executed from the repository root or another broadly scoped directory.
- Git overwrites all tracked modifications under that directory with their indexed versions.
- Uncommitted work that was not backed up, committed, or stashed is lost.
This does not grant an attacker additional privileges. The primary risk is accidental destructive action induced by unsafe recovery guidance.
Impact Assessment
The command executes with the invoking user's existing filesystem permissions. It can discard all tracked, uncommitted modifications within the selected Git worktree, including source code, configuration changes, documentation, and other unrelated work.
The impact is limited to tracked files covered by the Git command; untracked files are not removed by
git checkout -- .. Nevertheless, the affected scope may be the entire repository, and recovery may be impossible if the cha ...[truncated 72 chars]- Remediation
View remediation
Remediation Suggestions
Replace the repository-wide command with a targeted restoration process:
- Run
git status --shortandgit diff --name-onlyto identify modified files. - Determine which changes are demonstrably attributable to the suspect Skill.
- Preserve current work with a backup, patch, commit, or
git stash push -ubefore modifying files. - Present the exact files and changes to the user and require explicit confirmation.
- Restore only confirmed affected paths, for example with
git restore -- path/to/affected-file. - Avoid destructive commands when attribution is uncertain; restore from a verified backup or manually revert reviewed changes instead.
- Clearly warn that repository-wide restoration can destroy unrelated uncommitted work.
- Run
