T09 · Insecure Skill Coding Practices
- Location
scripts/run-nightly-scan.sh:81- Finding
Memory-derived reviews, logs, and generated skill drafts bypass deterministic secret scrubbing
- Content
View full analysis
> "$LOG" 2>&1 EXIT=$? elif [ "$FORGE_RUNNER" = "claude" ]; then # Note: Claude Code blocks file-read permission bypass as root (security policy). # The claude runner requires running as a non-root user. As root, use FORGE_RUNNER=openclaw. if [ "$(id -u)" = "0" ]; then echo "WARNING: claude runner cannot bypass file permissions as root (Claude Code security policy)." >> "$LOG" echo "Use FORGE_RUNNER=openclaw (default) or run as a non-root user for the claude runner." >> "$LOG" rm -f "$PROMPT_FILE" exit 1 fi claude --print \ --model sonnet \ --effort high \ --permission-mode auto \ --max-budget-usd "$MAX_BUDGET_USD" \ < "$PROMPT_FILE" >> "$LOG" 2>&1 EXIT=$? ``` After execution, the review is promoted without scrubbing. Only the JSON state temporary file is passed through `scrub_file_in_place`: ```bash if [ "$EXIT" -eq 0 ]; then if ! atomic_text_write "$REVIEW_DIR/$TODAY.md.tmp" "$REVIEW_DIR/$TODAY.md"; then echo "[skillminer] ERROR: nightly review tmp failed non-empty check, keeping previous state" >> "$LOG" rollback_state_and_review "review tmp failed non-empty check" VALIDATION_EXIT=2 elif ! { [ -f "$STATE_FILE.tmp" ] && scrub_file_in_place "$STATE_FILE.tmp"; true; } || ! atomic_json_write "$STATE_FILE.tmp" "$STATE_FILE" "$BACKUP_FILE"; then echo "[skillminer] ERROR: nightly state tmp failed JSON validation, restored backup" ...[truncated 4952 chars]- Remediation
View remediation
