T09 · Insecure Skill Coding Practices
- Location
references/reviewer-guide-template.md:252- Finding
Overbroad Automated Git Staging, Stashing, and Committing
- Content
View full analysis
Vulnerability Details
File Location:
references/reviewer-guide-template.md, lines 252–271
Vulnerability Type: Overbroad repository modification and unintended data inclusion
Risk Level: MediumVulnerable Code
bash cd .. git add src/ git stash save "Before execution of round [N] planning"bash # Step 1: Update VERSIONS.md # Append new version record to VERSIONS.md (format as shown in VERSIONS.md) # Step 2: Commit version git add -A git commit -m "V{date}-{time} V{version} - [execution round summary]"The related high-level instruction also appears in
SKILL.md, lines 224–229:markdown - **When planning review passes**: Execute `git add <code_dir> && git stash save` to save a code snapshot (default src/, `.pre/` excluded via .gitignore) - **When execution review passes**: Update `VERSIONS.md` and execute `git commit -m "V{date}-{time} V{version} - [description]"`Technical Analysis
The generated Reviewer guide instructs an autonomous agent to manipulate the repository without restricting operations to files that were actually reviewed.
Staging
src/before runninggit stash savedoes not reliably limit the stash tosrc/. The default stash operation can include tracked working-tree modifications elsewhere in the repository. Consequently, unrelated tracked changes may be removed from the working tree and placed in the stash.The subsequent
git add -Ais broader still: it stages additions, modifications, and deletions across the entire repository. This may include unrelated user work, generated artifacts, local configuration,.pre/files if the assumed ignore rule is absent, or accidentally stored credentials. The automated commit then permanently records that content in Git history.The template states that
.pre/is excluded through.gitignore, but the skill does not create or verify such an exclusion. It also provides no sensitive-file filtering, reviewed-path allowlist, staged-diff inspection, ...[truncated 1795 chars]- Remediation
View remediation
Remediation Suggestions
- Remove
git add -Afrom the autonomous workflow. - Stage only exact deliverable paths recorded in the approved collaboration-log entry:
bash git add -- path/to/reviewed-file-1 path/to/reviewed-file-2 VERSIONS.md - Canonicalize and validate every deliverable path before staging. Require paths to remain inside the configured code directory and reject traversal, symbolic-link escapes,
.git/,.pre/, credential files, and local environment files. - Replace the broad stash command with a path-scoped operation where supported, or avoid automatic stashing entirely. Do not assume prior staging limits the default stash scope.
- Before committing, require inspection of:
bash git status --short git diff --cached --name-status git diff --cached - Abort if staged files differ from the reviewed allowlist.
- Require explicit human confirmation before creating a commit, especially when new files, deletions, configuration files, or files outside the code directory are present.
- Add and verify ignore rules for
.pre/,.env*, private keys, credentials, generated artifacts, and local configuration. Ignore rules should supplement, not replace, explicit staging. - Add secret scanning as a pre-commit validation step and stop the workflow if potential credentials or private keys are detected.
- Update
SKILL.mdand the generated Reviewer template consistently so neither document recommends unscoped staging or stashing.
- Remove
