T09 · Insecure Skill Coding Practices
- Location
SKILL.md:9- Finding
Unreviewed untracked files may be committed and pushed to a remote repository
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 9-20
Vulnerability Type: Unsafe bulk staging and remote publication of unreviewed files
Risk Level: MediumVulnerable Code Snippet:
markdown - Current git status: !`git status` - Current git diff (staged and unstaged changes): !`git diff HEAD` - Current branch: !`git branch --show-current` - Recent commits: !`git log --oneline -10` ## Your task Based on the above changes, stage everything, create one commit with a contextual message, and push the current branch. Required sequence: 1. Stage changes. 2. Create a single commit. 3. Push the current branch to origin (use `--set-upstream origin <branch>` if needed).Technical Analysis
The Skill directs the agent to stage every working-tree change and push the resulting commit to
origin. Its review context usesgit diff HEAD, which displays tracked changes but does not show the contents of untracked files. Althoughgit statusidentifies untracked paths, it does not provide enough information to determine whether those files contain credentials, private data, generated artifacts, or unrelated content.As a result, untracked files can be added to the commit without a content-level security review. The mandatory push then publishes those files using the invoking user's existing Git credentials. The behavior violates least-change principles and creates a potential data-exposure path. This finding does not represent privilege escalation: its scope is limited to repositories and remotes that the current user is already authorized to modify.
Attack Path
- An attacker, compromised development tool, or accidental local operation places an untracked file in the repository.
- The file contains sensitive information or other content that should not be published, such as an API key, environment file, private certificate, database export, or generated artifact.
- The Skill eva ...[truncated 1136 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace bulk staging with explicit staging of individually reviewed paths.
- Enumerate all candidate files using a machine-readable command such as
git status --porcelain=v1 -z. - Inspect tracked changes and the contents of every untracked file before staging. Do not rely solely on
git diff HEAD. - Reject or require explicit approval for files commonly associated with secrets or private data, including
.envfiles, private keys, credential stores, database dumps, and cloud configuration files. - Run an approved secret scanner against the exact staged snapshot before creating the commit.
- Review the staged result with
git diff --cachedand verify the staged file list before committing. - Require user confirmation before pushing, particularly when new files, binary files, sensitive paths, or upstream-branch changes are involved.
- Ensure generated artifacts and local configuration files are covered by an appropriate
.gitignore. - If sensitive material has already been pushed, revoke and rotate affected credentials, remove the material from repository history where appropriate, and assess remote clones, forks, caches, and CI logs for further exposure.
