T09 · Insecure Skill Coding Practices
- Location
scripts/publish.sh:174- Finding
Unrestricted Directory Contents May Be Published to a Public GitHub Repository
- Content
View full analysis
/dev/null 2>&1; then gh repo create "$SKILL_NAME" --public --source=. --remote=origin --push || { ``` ### Technical Analysis The script executes `git add .`, recursively staging every non-ignored file under the selected skill directory. It subsequently invokes `gh repo create` with the `--public` and `--push` options, causing the staged contents to be uploaded to a publicly accessible GitHub repository. No controls are implemented to: - Restrict publication to an explicit allowlist of expected skill files. - Detect credentials, private keys, access tokens, `.env` files, logs, backups, or local configuration. - Verify that an effective `.gitignore` exists. - Display and validate the complete staged file list before publication. - Scan the commit or Git history for secrets. - Obtain a dedicated confirmation acknowledging that the repository will be public. The general publication confirmation does not identify the files that will be exposed. Although ignored files are not staged, the script does not establish or validate ignore rules. Sensitive files already tracked in an existing repository may also be pushed through the existing-repository branch. ### Attack Path 1. A sensitive file, such as `.env`, a private key, an API token file, a configuration backup, or a log containing credentials, is present in the selected skill directory. 2. The file is not covered by an existing `.gitignore` rule, or it is already tracked by Git. 3. The user approves the general GitHub and ClawdHub publicat ...[truncated 1294 chars]- Remediation
View remediation
