T09 · Insecure Skill Coding Practices
- Location
SKILL.md:130- Finding
Repository-wide staging can publish unrelated or sensitive workspace files
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 130–146
Vulnerability Type: Unscoped source-control staging and remote publication
Risk Level: MediumVulnerable instructions:
bash git status git diff --stat git add -A git commit -m "<type>: <description>" git push -u origin <branch-name>Technical Analysis
The workflow instructs the agent to run
git add -A, which stages every tracked modification, deletion, and untracked file that is not ignored across the repository. The subsequent mandatory commit and push publish that entire staged state to the remote development branch.The preceding
git statusandgit diff --statcommands only display information. The instructions do not require the agent to reject unexpected files, inspect the complete staged diff, restrict staging to files approved by the design, or obtain explicit confirmation for unexpected content. Consequently, pre-existing workspace changes can cross the boundary from the local filesystem to the remote repository even when they are unrelated to the user's requested coding task.Attack Path
- An unrelated user, process, tool, or earlier task leaves a modified or untracked file in the repository workspace.
- The coding SOP is invoked for a separate development request.
- At the commit stage, the agent executes
git add -A, staging both the authorized implementation and the unrelated file. - The agent commits the complete staged state.
- The agent executes
git push -u origin <branch-name>. - The unrelated content becomes accessible to users or systems with access to that remote branch.
This path does not require a force push or publication to
mainormaster; disclosure can occur through an ordinary development branch.Impact Assessment
The operation uses the agent's existing repository write credentials. Its scope is limited to content present in the current re ...[truncated 538 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace
git add -Awith explicit staging of only the files listed in the approved design, such asgit add -- path/to/file1 path/to/file2. - Record the expected file set before coding and fail closed when
git status --porcelainreports unexpected paths. - Review the complete staged patch with
git diff --cached --statandgit diff --cachedbefore committing. - Scan staged content for credentials and other sensitive material before publication.
- Require explicit user confirmation if unrelated pre-existing changes must be included.
- After committing, verify the exact commit contents with
git show --stat --name-status HEADbefore pushing. - Preserve the existing prohibition on force pushes and the requirement for explicit approval before pushing to the main branch.
- Replace
