secondbrain icon indicating copy to clipboard operation
secondbrain copied to clipboard

[Security] Exported Memory Contains Sensitive Data - No Encryption

Open anshul23102 opened this issue 5 months ago • 0 comments

Description

When users export their memory collection (for backup or sharing), the exported file contains all data unencrypted. Sensitive information including personal notes, API keys in context, and private documents are exposed in plaintext. No encryption or redaction is applied.

Steps to Reproduce

  1. User creates memory entries with sensitive information (e.g., personal notes, research)
  2. User exports memory collection via "Export All Memories" feature
  3. Exported file is JSON/CSV with all entries in plaintext
  4. If file is shared or stored unencrypted, data is exposed
  5. Attacker can read API keys, personal information, private research

Environment Information

  • Export format: JSON or CSV file
  • Storage location: User's local system or cloud
  • Encryption: None currently implemented
  • Data includes: Text, embeddings, metadata, timestamps

Expected Behavior

  • Export should be encrypted with user's key
  • Sensitive fields should be redacted or masked
  • User should select what to export (not all-or-nothing)
  • Audit log should track export operations
  • File should have encrypted extension (.enc, .gpg)

Actual Behavior

  • Export is plaintext JSON/CSV
  • All fields included without filtering
  • No encryption or password protection
  • No audit trail of exports
  • File is easily readable

Code Reference

  • File: src/export/memory_exporter.py
  • Method: export_all() - writes plaintext JSON
  • Missing: Encryption module integration
  • Missing: Field filtering/redaction logic

Additional Context

This is a Level 1 security vulnerability (data exposure). The fix requires:

  • Implementing encryption (AES-256) with user-derived key
  • Adding field-level visibility controls
  • Implementing export audit logging
  • Adding password protection option
  • Documenting secure export best practices

Suggested Labels

security, encryption, data-protection, privacy, export

anshul23102 avatar Jun 03 '26 18:06 anshul23102