T09 · Insecure Skill Coding Practices
- Location
SKILL.md:59- Finding
Blanket Git staging may expose sensitive files through a public repository
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 59–63
Vulnerability Type: Unsafe release and source-control procedure
Risk Level: MediumComplete Code Snippet:
bash git add -A && git commit -m "Version -> <v>" && git push git rev-parse HEADbash gh repo create <owner>/<repo> --public --source . --pushTechnical Analysis
The documented release procedure uses
git add -A, which stages every changed, deleted, or untracked file not excluded by Git ignore rules. It then instructs the user to push the resulting commit. For an initial release, it explicitly creates a public GitHub repository and pushes the current source tree.The procedure does not require users to validate
.gitignore, inspect the staged diff, or run secret scanning before publication. Consequently, an unignored sensitive file in the working tree—such as an environment file, private key, access token, internal configuration, personal data, or unrelated proprietary artifact—can be included in the commit and disclosed publicly.This is an unsafe release practice rather than evidence of intentional exfiltration. The publishing and network operations otherwise correspond to the Skill's declared purpose.
Attack Path
- A sensitive file exists within the repository working tree and is not covered by
.gitignore. - The user follows the Skill's release procedure and executes
git add -A. - Git stages the sensitive file together with the intended release files.
- The user commits without reviewing the staged file list and diff.
git push, orgh repo create ... --public --push, publishes the commit to a public GitHub repository.- External parties can retrieve the exposed data from the repository or its Git history, including after a later working-tree deletion unless the history is rewritten.
Impact Assessment
The issue does not directly grant additi ...[truncated 621 chars]
- A sensitive file exists within the repository working tree and is not covered by
- Remediation
View remediation
Remediation Suggestions
- Replace blanket staging with an explicit allowlist of expected release files, for example:
bash git add SKILL.md skill.json sync.py clawhub-skill plugin .claude-plugin - Require review before every commit and push:
bash git status --short git diff --cached --stat git diff --cached - Establish and validate a comprehensive
.gitignorecovering environment files, credentials, private keys, local configuration, build output, editor files, and temporary artifacts. - Run a secret scanner such as Gitleaks or TruffleHog against both the working tree and staged content before publication.
- Require explicit user confirmation before creating a public repository; default to a private repository when public access is not necessary.
- Add an automated pre-push or CI control that rejects commits containing high-confidence secrets or prohibited file patterns.
- Document an incident-response procedure for accidental disclosure: revoke and rotate exposed credentials immediately, remove sensitive content from Git history, force-push sanitized history where appropriate, and review downstream mirrors or registry copies.
- Replace blanket staging with an explicit allowlist of expected release files, for example:
