T09 · Insecure Skill Coding Practices
- Location
scripts/publish-template.sh:23- Finding
Sensitive Files Can Be Committed and Uploaded to GitHub
- Content
View full analysis
/dev/null || true) if [ -n "$sensitive_files" ]; then echo "⚠️ Potentially sensitive files detected:" echo "$sensitive_files" echo "" read -rp "Continue anyway? (y/N) " confirm [[ "$confirm" =~ ^[Yy]$ ]] || exit 1 fi git add -A git commit -m "Initial commit: agent context system template" 2>/dev/null || true gh repo create "$GH_USER/$REPO_NAME" \ --private \ --source=. \ --remote=origin \ --description "Template: persistent local-only memory for AI coding agents" \ --push ``` ### Technical Analysis The script searches for several sensitive filename patterns, but detection only produces an overridable warning. If the user confirms, `git add -A` stages the entire working tree, including the files that triggered the warning. The resulting commit is then uploaded through `gh repo create --push`. The check is also incomplete: - It only searches to a maximum depth of two directories. - It relies on a limited list of filename patterns. - It does not inspect file contents for credentials or tokens. - It does not verify the final staged-file list. - It does not enforce an allowlist of files required for the template. - It suppresses commit errors, making the resulting repository state less transparent. Creating a private repository does not eliminate the exposure. The files are still transferred to GitHub, become accessible to authorized repository users and integrations, and remain in Git history unless the history is explicitly rewritten. The static pre-scan characterized this behavior as writing to SSH key files. That characterization is inaccurate: th ...[truncated 1656 chars]- Remediation
View remediation
