T09 · Insecure Skill Coding Practices
- Location
SKILL.md:72- Finding
Unscoped Git Staging and Autonomous Repository Commits
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 67–83 and line 130
Vulnerability Type: Unsafe repository modification and unscoped Git staging
Risk Level: MediumVulnerable Code
Lines 72 and 83 require staging every change in the repository before committing:
bash git add -A && git commit -m "vibe: [dimension] fix [subproblem] — summary"bash git add -A && git commit -m "vibe: [dimension] improve from X to Y — summary"Line 130 additionally instructs the agent to execute the workflow directly without asking whether it should continue, except when it encounters an ambiguity that it cannot resolve.
Technical Analysis
The
git add -Acommand stages all non-ignored changes visible to Git across the working tree. Its scope is not restricted to files modified by the Skill. Consequently, unrelated tracked-file modifications, deletions, and non-ignored untracked files already present in the repository can be included in the mandatory commits.The workflow does not require inspection of
git status, review of the staged diff, secret scanning of staged content, or user approval before committing. The instruction to continue autonomously compounds this issue because the user may not receive an opportunity to detect or exclude unrelated content before it becomes part of Git history.This is an insecure coding practice rather than a privilege-escalation flaw. The Skill operates with the agent's existing repository and Git permissions; it does not obtain additional system privileges.
Attack Path
- A repository contains an unrelated modified file or a non-ignored untracked file. This could include local configuration, credentials, API tokens, private notes, or unfinished user work.
- The user invokes the Skill to assess and improve the project.
- The Skill modifies files while following its scorecard workflow.
- The mandated
git add -Acommand stages bot ...[truncated 1124 chars]
- Remediation
View remediation
Remediation Suggestions
-
Replace
git add -Awith explicit staging of only the files intentionally modified by the current remediation task:bash git add -- path/to/modified-file path/to/test-file -
Capture the initial repository state with
git status --shortbefore making changes. Treat all pre-existing modifications and untracked files as out of scope. -
Before each commit, require these checks:
bash git status --short git diff --cached --stat git diff --cached -
Unstage any file not explicitly associated with the current subproblem:
bash git restore --staged -- path/to/unrelated-file -
Run secret detection against the staged diff before committing, and block commits containing credentials, private keys, tokens, or sensitive configuration.
-
Do not automatically commit when the working tree was already dirty. Either preserve and exclude pre-existing changes reliably or request user confirmation.
-
Revise the autonomous-execution instruction so that repository commits require explicit approval, especially when staged files include content not created or modified by the Skill.
-
Document every file included in a commit and verify that the commit contains changes for only one intended subproblem.
-
