T09 · Insecure Skill Coding Practices
- Location
scripts/summarize.sh:20- Finding
Unfiltered Clipboard and Notification Data Is Persisted and Exposed in Process Output
- Content
View full analysis
/dev/null | head -1) if [ -n "$CLIPBOARD_FILE" ]; then CLIPBOARD_CONTENT=$(cat "$CLIPBOARD_FILE") else CLIPBOARD_CONTENT="今日无剪贴板记录" fi else CLIPBOARD_CONTENT="无剪贴板数据" fi ``` ```bash if [ -d "$NOTIF_DIR" ]; then NOTIF_FILE=$(ls -t "$NOTIF_DIR"/*.md 2>/dev/null | head -1) if [ -n "$NOTIF_FILE" ]; then NOTIF_CONTENT=$(cat "$NOTIF_FILE") else NOTIF_CONTENT="今日无通知记录" fi else NOTIF_CONTENT="无通知数据" fi ``` ```bash cat > "$OUTPUT_FILE" << EOF === 今日剪贴板(用户输入)=== $CLIPBOARD_CONTENT === 今日通知(收到的消息)=== $NOTIF_CONTENT === 今日联系人更新 === $CONTACTS_UPDATE_LOG EOF echo "" echo "✅ 完成!" echo " - Memory: $OUTPUT_FILE" echo " - Contacts: $CONTACTS_DIR" echo "" echo "--- 预览 (前30行) ---" head -30 "$OUTPUT_FILE" ``` ### Technical Analysis The script reads raw clipboard and notification records without applying data classification, secret detection, redaction, or content minimization. Clipboard and notification data commonly contain passwords, authentication tokens, password-reset links, private correspondence, email addresses, internal project details, and other sensitive information. The resulting data is written in plaintext to `memory/YYYY-MM-DD.md`. The script does not establish a restrictive `umask` or explicitly set the output file to owner-only permissions. Consequently, the effective permissions depend on the invoking environment and may allow unintended local access. The final `head -30 "$OUTPUT_FILE"` command also writes the first 30 lines of this sensitive output to standard output. When invoked through a scheduled task, stdout may be retained in task logs, monitoring systems, termina ...[truncated 1457 chars]- Remediation
View remediation
