T09 · Insecure Skill Coding Practices
- Location
scripts/publish-template.sh:23- Finding
Sensitive Files Can Be Staged 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 attempts to identify sensitive files, including environment files, PEM files, private keys, secrets, and SSH private-key filenames. It does not write to or modify SSH keys; the pre-scan warning is caused by filename matching. The security issue is that detection only produces a warning. A user can continue despite detected secrets, after which `git add -A` stages all non-ignored content and `gh repo create --push` uploads the resulting commit. The scan is also incomplete: - It only searches to a maximum depth of two directories. - It relies on a limited set of filename patterns. - It does not inspect the actual staged file set. - It does not scan file contents for tokens or credentials. - It does not explicitly verify that `.agents.local.md` is ignored. - It stages the entire working tree instead of an allowlist of intended template files. Creating the repository as private reduces public exposure, but uploaded secrets remain available to repository collaborators, installed GitHub applications, automation, backups, and anyone who later receives access. Se ...[truncated 1372 chars]- Remediation
View remediation
