Security Model Overview
ClipSync uses a session-based security model with the following characteristics:- Session isolation: Each session is identified by a unique 5-character code
- No authentication: Access is controlled solely by knowing the session code
- Public database access: Uses Supabase anonymous key for client-side operations
- HTTPS encryption: All data transmission uses TLS encryption
- Client-side compression: Images compressed locally before upload
Session Code Security
How Session Codes Work
Session codes are 5-character alphanumeric strings generated client-side:src/service/doc.service.js:4-8
Code Space and Collision Risk
- Character set: 36 characters (26 letters + 10 digits)
- Code length: 5 characters
- Total possible codes: 36^5 = 60,466,176 combinations
- With 1,000 active sessions: ~0.0017% chance of collision
- With 10,000 active sessions: ~0.017% chance of collision
- With 100,000 active sessions: ~0.17% chance of collision
The likelihood of randomly guessing an active session code is extremely low, providing practical security through obscurity.
Session Code Best Practices
Don't Share Session Codes Publicly
Don't Share Session Codes Publicly
Use Unique Sessions for Different Purposes
Use Unique Sessions for Different Purposes
Risk: Mixing personal and shared content in one session exposes personal data to others.Best practice:
- Create separate sessions for:
- Personal device sync
- Team collaboration
- Temporary file transfers
- Different projects or clients
Delete Sessions After Use
Delete Sessions After Use
Risk: Old sessions remain accessible indefinitely if session code is known.Best practice:
- Clear clipboard history when done with temporary sessions
- Leave sessions you no longer need
- Don’t reuse old session codes for new purposes
src/App.jsx:225-243 (delete all feature)Save Session Codes Securely
Save Session Codes Securely
Risk: Session codes stored insecurely can be accessed by others.Best practice:
- Store codes in password managers
- Don’t save in plain text files on shared computers
- Use the browser’s local storage (automatic)
- Be cautious with screenshot/screen sharing while code is visible
Sensitive Content Feature
ClipSync includes a “Sensitive” flag to protect private information in clipboard history.How It Works
Mark Content as Sensitive
Before sending content, check the “Sensitive” checkbox at the bottom-right of the text area.Referenced in:
src/App.jsx:531-536Content is Synced But Hidden
The content is:
- Stored in the database normally
- Synced to all devices in the session
- Replaced with asterisks in the history view
src/utils/index.js:2-5Sensitive Flag Implementation
src/utils/index.js:1-11
When to Use Sensitive Flag
Recommended for:- Passwords and credentials
- API keys and tokens
- Personal identification numbers
- Private addresses or phone numbers
- Financial information
- Any content you don’t want visible on screen
- End-to-end encryption
- Password managers
- Secure credential storage
- Compliance with data protection regulations
Data Encryption in Transit
HTTPS/TLS Encryption
All communication between ClipSync and Supabase is encrypted:src/config/supabase.js:1-5
What’s encrypted:
- HTTP API requests (POST, GET, DELETE)
- WebSocket connections (Real-time subscriptions)
- File uploads to storage
- Database queries
- Protocol: TLS 1.2 or higher
- Managed by Supabase infrastructure
- Same level of encryption as banking sites
What’s NOT Encrypted at Rest
Unencrypted data:- Session codes in
sessionstable - Clipboard text content in
clipboardtable - File metadata (names, paths, types)
- Uploaded files in storage bucket
- Timestamps and session associations
- Use sensitive flag for private content
- Delete content after use
- Don’t store highly sensitive data long-term
- Consider self-hosting for full control
Supabase Security
Anonymous Key Usage
ClipSync uses Supabase’s anonymous (public) key:src/config/supabase.js:2
What this means:
- Key is visible in client-side code (by design)
- Same key for all users
- Access control via Row Level Security (RLS) policies
- No per-user authentication
The anonymous key is safe to expose in client-side code. It’s designed for public access, with security enforced through database policies.
Row Level Security (RLS)
Supabase uses PostgreSQL RLS to control data access:- Permissive policies allowing all operations
- Session isolation enforced at application level
- No user authentication required
- Anyone can query the database
- Session codes provide only logical separation
- Physical security depends on code secrecy
Storage Bucket Security
File uploads use a public storage bucket:src/App.jsx:151
Bucket configuration:
- Name:
clipboard - Access: Public (required for direct file access)
- Max file size: 10MB (enforced at application level)
- All uploaded files are publicly accessible
- File URLs are predictable (bucket/files/[prefix][filename])
- No automatic expiration (files persist until deleted)
- 3-character random prefix prevents some collisions
src/App.jsx:130-134 (random prefix generation)
Best Practices for Sensitive Data
What to Store in ClipSync
Safe to store:- Public links and URLs
- Non-sensitive text snippets
- Code samples (without credentials)
- General notes and reminders
- Public file transfers
- Temporary collaboration content
- Passwords (use sensitive flag, delete after use)
- API keys (use sensitive flag, rotate keys regularly)
- Personal information (minimize retention time)
- Work documents (check company policies)
- Files with metadata (EXIF data, document properties)
- Credit card numbers
- Social security numbers
- Private keys or certificates
- Highly confidential business data
- Medical records
- Data subject to regulatory compliance (HIPAA, GDPR, etc.)
Data Retention Strategy
Immediate Deletion
Delete content immediately after it’s been accessed on target device.How:
- Copy content to device clipboard
- Click edit button (✏️) on the item
- Click delete (🗑️) to remove from all devices
src/App.jsx:249-266Session Cleanup
Regularly clear all clipboard history in active sessions.How:
- Click delete all button (🗑️) in clipboard history header
- Confirm deletion
- All content and files are permanently removed
src/App.jsx:225-243Secure Workflows
Password Transfer Workflow
File Transfer Workflow
Session Isolation
How Isolation Works
Each session is logically isolated by its session code:src/App.jsx:33-36, src/App.jsx:69-73
Isolation guarantees:
- Each session only sees its own clipboard items
- Real-time updates filtered by session code
- Database queries restricted to current session
- File uploads tagged with session association
src/App.jsx:390-392
Cross-Session Security
Can users access other sessions?- Not through the application UI
- Theoretically possible via direct database queries
- Session codes must be known or guessed
- Session codes are random and unpredictable
- No session listing or discovery feature
- Application enforces session filtering
- Real-time subscriptions filtered by session
Session isolation is enforced at the application level, not the database level. Users with database access can query across sessions.
Security Limitations
Known Limitations
Technical Limitations
- No end-to-end encryption: Data readable by database administrators
- No user authentication: Access control via session codes only
- No access logs: Can’t track who accessed what content
- No permission system: All session members have full access
- No session expiration: Sessions persist indefinitely
- Public storage: Uploaded files accessible via URL
Threat Model
Protected against:- Casual browsing by non-participants
- Accidental data exposure in session history (via sensitive flag)
- Man-in-the-middle attacks (via HTTPS)
- Network eavesdropping (via TLS encryption)
- Intentional session code guessing (low probability)
- Database administrator access
- Compromised Supabase credentials
- Client-side attacks (XSS, if vulnerabilities exist)
- Screen capture or shoulder surfing
- Shared computer access (session stored in browser)
Privacy Considerations
Data Storage Duration
Content persists until explicitly deleted:- No automatic expiration
- Sessions remain active indefinitely
- Files stored permanently until deleted
- No data retention policies by default
Data Visibility
Who can see your data:- You and session participants: Via application UI
- Database administrators: Via direct database access
- Supabase staff: In rare cases for support or maintenance
- Backup systems: Data included in database backups
- Potential attackers: If session code is compromised
Metadata Leakage
Exposed metadata:- File names (visible in storage URLs)
- Upload timestamps
- Session creation times
- Number of items in session
- File sizes and types
Compliance Considerations
GDPR and Data Protection
If using ClipSync with EU user data:- Right to deletion: Implement via delete all feature
- Data portability: No export feature currently
- Purpose limitation: Use separate sessions for different purposes
- Data minimization: Delete content after use
- Storage limitation: No automatic expiration
HIPAA and Healthcare Data
Missing HIPAA requirements:- No audit controls
- No user authentication
- No access controls
- No encryption at rest
- No business associate agreement (BAA)
Recommendations for Enhanced Security
If you need stronger security:1. Self-Host ClipSync
- Full control over data storage
- Implement custom security policies
- Add authentication layer
- Enable encryption at rest
- Control backup and retention
2. Implement Authentication
3. Add End-to-End Encryption
Encrypt content before sending to database:4. Implement Session Expiration
Automatically delete old sessions:5. Add Row Level Security
Stricter RLS policies:Next Steps
Setup Supabase
Configure backend with security best practices
Multi-Device Sync
Learn secure workflows for device synchronization