T09 · Insecure Skill Coding Practices
Error
- Location
- scripts/pipeline.sh:90
- Finding
- Dry-run mode performs local mutations and cloud uploads<![CDATA[ ## Vulnerability Details **File Location**: `scripts/pipeline.sh:90-99, 114-130`; related defaults in `config/sync-config.json:2-4` and upload operations in `scripts/sync.sh:54-62, 90-104` **Vulnerability Type**: Dry-run contract violation and unintended data disclosure **Risk Level**: High ### Vulnerable Code ```bash organize) log "📂 Step 2/5: Running file organizer..." if bash "$SCRIPT_DIR/organize.sh" 2>&1 | tee -a "$STEP_LOG"; then pass "Organize complete" else warn "Organize completed with warnings" fi ;; ``` ```bash sync) log "☁️ Step 5/5: Running cloud sync (optional)..." # Sync is optional - don't count as failure if skipped if bash "$SCRIPT_DIR/sync.sh" 2>&1 | tee -a "$STEP_LOG"; then pass "Sync complete" else SYNC_EXIT=${PIPESTATUS[0]} if [ $SYNC_EXIT -eq 0 ]; then pass "Sync skipped (gog not configured)" else warn "Sync completed with warnings" fi fi ;; ``` The default synchronization configuration enables human workspace and core-file uploads: ```json { "sync_human": true, "sync_agent": false, "sync_backup": true, "output_folder": "AI_Workspace", "backup_folder": "AI_Workspace_Backup", "_comment": "Set sync_human/sync_agent to true to enable, false to skip. Requires gog CLI installed and authenticated." } ``` The corresponding upload operations are: ```bash if [ "$SYNC_HUMAN" = "true" ] && [ -d "$HUMAN" ]; then echo "📁 Syncing Workspace_Human/..." echo " → $OUTPUT_FOLDER/Workspace_Human/" FILE_COUNT=$(find "$HUMAN" -type f 2>/dev/null | wc -l || echo 0) echo " Files: $FILE_COUNT" if [ "$FILE_COUNT" -eq 0 ]; then echo " ℹ️ Nothing to sync" elif gog drive sync upload "$HUMAN/" ...[truncated 2382 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Enforce dry-run centrally so that every mutating or networked stage is skipped or receives an explicit dry-run flag. - Do not invoke `sync.sh` at all when `DRY_RUN=true`. - Add dry-run support to `organize.sh` that reports proposed source and destination paths without calling `mv`. - Require an explicit option such as `--sync`; do not include cloud synchronization implicitly in a default or dry-run pipeline. - Change synchronization defaults to false, especially for core memory, identity, and user-profile files. - Before any upload, display the exact files, destination account, and remote folder, then require explicit confirmation. - Add automated tests asserting that dry-run causes no filesystem metadata changes and no external process capable of network transmission is invoked. ]]>
