T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:22
- Finding
- Unattended Public GitHub Publication May Expose Sensitive Repository Content and History<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:22`, `SKILL.md:102-110`, and `SKILL.md:124-128` **Vulnerability Type**: Unsafe default-public repository creation and push **Risk Level**: High ### Vulnerable Code Snippets At `SKILL.md:22`: ```markdown - Default to automated public GitHub publication for folders without a Git remote. Determine the target owner/name if not obvious, then create a public remote and push documentation-only changes after secrets checks pass. ``` At `SKILL.md:102-110`: ```markdown For Git repositories without a remote: 1. Infer the GitHub owner from `gh` authentication and the repo name from the folder when possible; ask only if ambiguous. 2. Check for `gh` authentication before creating a remote. 3. Create a public GitHub repository by default. 4. Add `origin`, set the default branch, and push after reviewing staged changes and confirming no secrets are included. Recommended GitHub CLI flow, adapted to the project: ```bash git status --short git remote -v gh auth status gh repo create OWNER/REPO --public --source=. --remote=origin --push ``` ``` At `SKILL.md:124-128`: ```markdown - Existing README is strong: preserve structure and patch missing sections rather than rewrite. - No verified install/test commands: include clearly marked placeholders or "not yet documented" notes instead of inventing commands. - License unknown: add MIT by default unless the user requests a different license. - Possible secrets or private data: stop remote creation/push and report the risky paths. - No `gh` CLI or not authenticated: provide exact commands for the user to run, but still complete local docs polish and prepare a documentation-only commit if safe. ``` ### Technical Analysis The Skill makes creation of a **public** GitHub repository and publication of local repository content the default behavior. It only requires asking the user when the repository owner or name is ambiguous; it does not require explicit approval ...[truncated 3334 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. **Require explicit publication approval** - Never create a public repository solely from an inferred default. - Immediately before creation, display the exact owner, repository name, visibility, source directory, branch, and refs intended for publication. - Require an affirmative user response specifically approving public visibility and the push. 2. **Default to private visibility** - Use a private repository unless the user explicitly requests public release. - Separate repository creation from any push so the user can review both decisions independently. 3. **Remove automatic `--push` behavior** - Create the remote without `--push`. - Add and verify the remote separately. - Push only an explicitly reviewed branch and refspec, rather than relying on broad CLI defaults. A safer conceptual sequence is: ```bash gh repo create OWNER/REPO --private git remote add origin EXPECTED_REMOTE_URL git remote get-url origin git push origin REVIEWED_BRANCH:REVIEWED_BRANCH ``` 4. **Review the complete publication scope** - List local branches, tags, tracked files, and commits that would become reachable. - Show the user the exact commit range and refspec before pushing. - Confirm that only the intended branch is pushed. - Do not claim that the push is documentation-only when existing repository history contains source files. 5. **Scan current content and Git history** - Run secret detection against tracked files and all reachable history. - Inspect deleted files and historical revisions for credentials and private information. - Treat discovered credentials as compromised: revoke or rotate them before publication. - Block publication when scanning cannot be completed or produces unresolved findings. 6. **Verify repository suitability for open-source release** - Require confirmation that the user owns or is authorized to publish all tracked content. - Check fo ...[truncated 432 chars]
