T09 · Insecure Skill Coding Practices
- Location
SKILL.md:17- Finding
Unrestricted staging can publish sensitive or unrelated repository files
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 17–21
Vulnerability Type: Unrestricted file staging followed by remote publication
Risk Level: MediumVulnerable Code
markdown - Confirm status, then stage everything: `git status -sb` then `git add -A`. - Commit tersely with a conventional commit message: `git commit -m "{type}: {description}"` - Run checks if not already. If checks fail due to missing deps/tools, install dependencies and rerun once. - Push with tracking: `git push -u origin $(git branch --show-current)` - If git push fails due to workflow auth errors, pull from master and retry the push.Technical Analysis
The workflow uses
git add -A, which stages all modifications, deletions, and untracked files throughout the repository. It does not require the agent to inspect the staged diff, verify that each path is related to the requested task, scan for secrets, or obtain user confirmation.The staged content is subsequently committed and pushed to the configured
origin. Consequently, files unintentionally present in the working tree can cross a trust boundary and be transmitted to a remote Git repository. The behavior also conflicts with the narrower instruction to stage “intended changes” inagents/openai.yaml.Exploitation requires a sensitive or attacker-controlled file to be present inside the repository working tree and not excluded by Git ignore rules.
Attack Path
- A sensitive or unwanted file is created inside the working tree, such as an environment file, credential export, private key, generated configuration, or unrelated work product.
- The user invokes the Skill to stage, commit, push, and create a pull request.
git add -Astages the file without path-level validation.git commitpermanently records the content in Git history.git pushtransmits the commit to the configured remote.- Users, automation, or integrations with acc ...[truncated 815 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace
git add -Awith explicit staging of paths that are directly related to the requested task. - Display and review both
git status --shortandgit diff --cachedbefore committing. - Require explicit user confirmation of the staged file list before the commit and push operations.
- Reject or warn about common sensitive paths and extensions, including
.envfiles, private keys, credential exports, authentication files, and generated secrets. - Run an approved secret scanner against the staged content before committing.
- Separate staging, committing, and pushing into confirmation boundaries so that remote publication is not an automatic consequence of broad local staging.
- If sensitive content is accidentally pushed, revoke exposed credentials immediately and rewrite remote history where organizational policy permits.
- Replace
