T09 · Insecure Skill Coding Practices
- Location
SKILL.md:230- Finding
Unrestricted repository staging may expose sensitive files
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:166andSKILL.md:230
Vulnerability Type: Unrestricted Git staging and insufficient secret-exposure prevention
Risk Level: Mediumbash git add -A git commit git pushThe Skill identifies
.gitignoreas merely advisory atSKILL.md:166, despite acknowledging that its absence can cause sensitive files to be uploaded. It subsequently instructs the agent to stage every modified, deleted, and untracked file withgit add -AatSKILL.md:230.Technical Analysis
git add -Arecursively stages all repository changes. If the project contains an unignored.envfile, API token, registry credential, SSH key, generated configuration, database backup, or unrelated local artifact, that file will be included in the release commit.The requirement for user confirmation before external operations does not specify that the agent must display and obtain approval for the exact staged file list. A general release confirmation therefore may not provide the operator with enough information to detect accidental credential inclusion.
The Skill also does not require a secret scanner, validate ignore rules, or use an allowlist of release files before pushing.
Attack Path
- A sensitive or attacker-planted file is created within the project directory.
- The file is not excluded because
.gitignoreis missing or incomplete. - The operator invokes the standard release workflow.
- The Skill executes
git add -A, staging the sensitive file alongside legitimate release changes. - The operator approves the general release without reviewing the complete staged diff.
- The Skill commits and pushes the file to GitHub.
- Anyone with repository access, and potentially the public, can retrieve the exposed data from Git history.
Impact Assessment
This issue can disclose repository-local secrets and sensitive project data. Exposed credentials may subseq ...[truncated 391 chars]
- Remediation
View remediation
Remediation Suggestions
- Make a reviewed
.gitignoremandatory before permitting a release. - Replace
git add -Awith an allowlist of explicitly intended files or directories. - Display
git status --shortbefore staging andgit diff --cached --statplusgit diff --cachedafterward. - Require explicit approval of the staged file list rather than relying only on general release confirmation.
- Run a secret scanner such as Gitleaks or TruffleHog against both the working tree and staged changes.
- Reject common sensitive file types, including
.env, private keys, credential files, database backups, and cloud-provider configuration, unless individually approved. - If exposure occurs, rotate affected credentials immediately and purge sensitive content from Git history and downstream caches.
- Make a reviewed
