T09 · Insecure Skill Coding Practices
- Location
scripts/cashu/backup.sh:63- Finding
Unencrypted Cashu Wallet Backup Uploaded to IPFS
- Content
View full analysis
&1 || echo "unknown") echo "$BALANCE" > "$BACKUP_DIR/balance.txt" # Step 3: Record metadata cat > "$BACKUP_DIR/metadata.json" << EOF { "timestamp": "$TIMESTAMP", "date": "$(date -Iseconds)", "balance": "$BALANCE", "mint": "$CASHU_MINT_URL", "wallet_dir": "$CASHU_WALLET_DIR", "hostname": "$(hostname)", "sha256": "$(find "$BACKUP_DIR/cashu-wallet" -type f -exec sha256sum {} \; | sha256sum | cut -d' ' -f1)" } EOF # Step 4: Create tarball TARBALL="/tmp/cashu-backup-${TIMESTAMP}.tar.gz" tar -czf "$TARBALL" -C "$BACKUP_DIR" . # Step 5: Upload to IPFS and store CID in vault echo "🔐 Uploading encrypted backup to IPFS..." # Add to IPFS IPFS_RESULT=$(curl -s -X POST "http://localhost:5001/api/v0/add" \ -F "file=@${TARBALL}" 2>/dev/null) ``` ### Technical Analysis The script copies the complete Cashu wallet directory and creates a gzip-compressed tar archive. Compression does not provide confidentiality, and no encryption command or authenticated-encryption operation occurs before the archive is submitted to the local IPFS API. The comment at line 3 and the status message at line 95 describe the backup as encrypted, but the implementation uploads plaintext wallet contents inside a compressed archive. This misleading security claim can cause users to upload sensitive wallet material under the false assumption that it is cryptographically protected. IPFS is content-addressed and designed for distribution and r ...[truncated 1403 chars]- Remediation
View remediation
