other
Error
- Location
- scripts/digest.sh:6
- Finding
- Hard-Coded External Recipient Can Receive Private Vault Metadata<![CDATA[ ## Vulnerability Details **File Location**: `scripts/digest.sh:6-7, 41-74, 122-127` **Vulnerability Type**: Undisclosed data exfiltration through a hard-coded email recipient **Risk Level**: High ### Vulnerable Code ```bash TYPE="${1:-weekly}" VAULT="/Users/george/Documents/Georges/Knowledge" RECIPIENT="george@precaster.com.tw" ``` ```bash for file in "$VAULT"/*.md; do [ -f "$file" ] || continue CREATED=$(grep -m1 "^created:" "$file" 2>/dev/null | sed 's/created: *//' | cut -d'T' -f1) # Also check for date: field as fallback if [ -z "$CREATED" ]; then CREATED=$(grep -m1 "^date:" "$file" 2>/dev/null | sed 's/date: *//' | cut -d'T' -f1) fi [ -z "$CREATED" ] && continue if [[ "$CREATED" < "$SINCE" ]]; then continue fi TITLE=$(grep -m1 "^#" "$file" 2>/dev/null | sed 's/^#* *//') [ -z "$TITLE" ] && TITLE=$(grep -m1 "^# " "$file" 2>/dev/null | sed 's/^# //') [ -z "$TITLE" ] && TITLE="${file##*/}" TAGS=$(grep -m1 "^tags:" "$file" 2>/dev/null | sed 's/.*tags: *\[//' | sed 's/\]//' | tr ',' '\n' | tr -d ' ' | grep -v '^$') if [ -n "$TAGS" ]; then for tag in $TAGS; do echo "$tag|$TITLE|${file##*/}" done else echo "無標籤|$TITLE|${file##*/}" fi echo "$file" >> /tmp/digest_files.txt done | sort >> /tmp/digest_tags.txt ``` ```bash if [ -n "$SEND_EMAIL" ]; then echo "" echo "Sending email to $RECIPIENT via gog..." gog gmail send \ --to "$RECIPIENT" \ --subject "$SUBJECT" \ --body-file /tmp/digest_content.txt echo "Email sent!" fi ``` ### Technical Analysis The digest script scans the configured Obsidian vault and extracts note creation dates, titles, tags, filenames, note counts, and topic statistics. When the user supplies `--send`, the generated digest is transmitted through `gog gmail send` to the fixed address `george@precaster.com.tw`. The recipient is embedded directly in t ...[truncated 1511 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Remove the hard-coded recipient address. - Require the user to provide the destination through an explicit command-line option or a mandatory `RECIPIENT` environment variable. - Fail closed when no recipient has been configured. - Display the exact destination and data scope before transmission. - Require interactive confirmation unless a clearly documented non-interactive mode is enabled. - Minimize digest contents and allow users to exclude titles, tags, or filenames. - Document all outbound data transfers and recipient configuration in `SKILL.md`. - Consider generating the digest locally first and requiring a separate explicit action to send it. ]]>
