T09 · Insecure Skill Coding Practices
- Location
sync.sh:31- Finding
Backup Exclusions Can Be Bypassed, Allowing Sensitive Files to Be Uploaded
- Content
View full analysis
/dev/null || { # Fallback to cp if rsync fails rm -rf "$BACKUP_DIR/skills" cp -r "$WORKSPACE/skills" "$BACKUP_DIR/" } # === Safe Copy: Scripts using rsync with exclude patterns === if [[ -d "$WORKSPACE/scripts" ]] && [[ -n "$(ls -A "$WORKSPACE/scripts/" 2>/dev/null)" ]]; then rsync -a \ --exclude='.git' \ --exclude='AGENTS.md' \ --exclude='SOUL.md' \ --exclude='USER.md' \ --exclude='TOOLS.md' \ --exclude='IDENTITY.md' \ --exclude='HEARTBEAT.md' \ --exclude='SITES.md' \ --exclude='MEMORY.md' \ "$WORKSPACE/scripts/" "$BACKUP_DIR/scripts/" 2>/dev/null || { # Fallback to cp if rsync fails rm -rf "$BACKUP_DIR/scripts" cp -r "$WORKSPACE/scripts" "$BACKUP_DIR/" } fi ``` ### Technical Analysis The implemented exclusions do not match the documented security guarantees. Neither copy operation excludes `.env` files or `credentials` directories. The scripts copy also does not exclude `node_modules`. More critically, any nonzero `rsync` result invokes an unrestricted `cp -r` fallback. This fallback ignores every exclusion, including `.git`, personal Markdown files, dependency directories, and other sensitive content. Because stderr is discarded, users may not know that the insecure fallback was used. The subsequent secret scan is pattern-based and cannot guarantee detection of all credentials or sensit ...[truncated 1228 chars]- Remediation
View remediation
