T09 · Insecure Skill Coding Practices
- Location
scripts/bookmark.sh:257- Finding
Broad Markdown Staging Can Upload Unrelated Sensitive Files
- Content
View full analysis
/dev/null || true) ]]; then log_info "No changes to commit" return 0 fi log_info "Staging markdown files..." git add *.md # Also add .gitignore if exist if [[ -f ".gitignore" ]]; then git add .gitignore fi ``` The staged files are subsequently pushed to the configured GitHub repository: ```bash # Push to remote log_info "Pushing to remote: $GITHUB_REPO_PATH" # Set upstream on first push if ! git rev-parse --abbrev-ref --symbolic-full-name @{u} &>/dev/null; then git push -u origin "$branch" else git push origin "$branch" fi log_info "Push complete!" ``` ### Technical Analysis The script accepts any path supplied through `ARTICLE_BOOKMARK_DIR`, changes into that directory, and stages every root-level Markdown file using `git add *.md`. It does not verify that the directory is exclusively managed by the Skill, nor does it maintain a manifest of bookmark files created by the Skill. Consequently, if the configured directory is an existing project, notes directory, or Git repository, unrelated Markdown files are included in the commit. When `ARTICLE_BOOKMARK_GITHUB` is configured, the commit is pushed to GitHub. Remote synchronization is part of the declared functionality, so the network operation itself is legitimate. However, staging every Markdown file exceeds the minimum file-access scope necessary to save a newly created or modified bookmark. The script creates missing repositories as private, but it does not verify the visibility of an existing repository before uploading content. ### Attack Path 1. A user or untrusted configuration sets `ARTICLE_BOOKMARK_DIR` to an existing Git repository or directory containi ...[truncated 1443 chars]- Remediation
View remediation
