Skip to content

Security

Security considerations and best practices for Subtide.


Subtide is designed with security in mind. This document covers:

  • How your data is handled
  • API key security
  • Backend security
  • Browser extension security

Subtide processes:

Data Purpose Storage
Video audio Transcription via Whisper Temporary (deleted after processing)
Subtitles Translation via LLM Cached locally (optional)
API keys Authentication Local browser storage
Settings User preferences Local browser storage

Subtide does not:

  • Track your viewing history
  • Collect personal information
  • Send analytics to third parties
  • Store video content permanently
  • Share data between users
Video Audio → Backend (local) → Whisper → Transcription
↓
LLM API (your key)
↓
Translation
↓
Browser (display + cache)

All data stays within your control.


Your API keys are stored in Chrome’s chrome.storage.local:

  • Encrypted by Chrome’s storage system
  • Accessible only to the Subtide extension
  • Never transmitted to Subtide servers
  1. Use separate API keys for Subtide (not your primary development key)
  2. Set usage limits in your API provider dashboard
  3. Monitor usage regularly for unexpected charges
  4. Rotate keys periodically
  5. Revoke keys immediately if compromised
Tier Key Location Security Level
Tier 1 Browser User-controlled
Tier 2 Browser User-controlled
Tier 3 Server Admin-controlled
Tier 4 Server Admin-controlled

For Tier 3/4, the server admin is responsible for key security.


By default, the backend runs on localhost:5001:

Terminal window
# Only accessible from local machine
./subtide-backend

This is the most secure configuration for personal use.

If exposing the backend to a network:

  1. Use HTTPS with a valid certificate
  2. Configure CORS to allow only trusted origins:
    Terminal window
    CORS_ORIGINS=https://youtube.com,https://www.youtube.com
  3. Use a reverse proxy (nginx, Traefik) with rate limiting
  4. Enable firewall rules to restrict access

For Docker deployments:

# docker-compose.yml security settings
services:
subtide:
# Don't run as root
user: "1000:1000"
# Read-only filesystem where possible
read_only: true
# Limit resources
deploy:
resources:
limits:
cpus: '2'
memory: 4G
# Don't expose unnecessary ports
ports:
- "127.0.0.1:5001:5001" # Localhost only

Secure your environment:

Terminal window
# Don't commit .env files
echo ".env" >> .gitignore
# Use secrets management in production
# Example: Docker secrets, Kubernetes secrets, Vault

Subtide requests these permissions:

Permission Purpose Risk Level
storage Save settings and cache Low
activeTab Access current video page Low
scripting Inject subtitle UI Medium
tabCapture Capture audio for live translation Medium
offscreen Audio processing Low
host_permissions Access video sites Medium

The extension enforces a strict CSP:

"content_security_policy": {
"extension_pages": "script-src 'self'; object-src 'self'"
}

This prevents:

  • Inline script execution
  • External script loading
  • Plugin-based attacks

Only necessary files are web-accessible:

"web_accessible_resources": [{
"resources": [
"src/content/network_interceptor.js",
"src/content/shorts-interceptor.js",
"src/offscreen/audio-processor.js"
],
"matches": ["<all_urls>"]
}]

Threat Protection
API key theft Local storage encryption
Man-in-the-middle HTTPS for API calls
XSS attacks Strict CSP
Data leakage No external data transmission
Risk Mitigation
Malicious API providers Use trusted providers only
Compromised backend Run locally or verify server
Browser extension compromise Install from official sources
API key exposure Follow key security best practices

  • Run backend on localhost only
  • Use your own API key
  • Keep extension updated
  • Review extension permissions
  • Deploy backend with HTTPS
  • Configure CORS restrictions
  • Use Tier 3/4 with server-side keys
  • Implement rate limiting
  • Set up monitoring
  • Regular security updates
  • All items from Team/Shared
  • Use secrets management (Vault, etc.)
  • Enable audit logging
  • Implement authentication (if needed)
  • Regular security audits
  • Incident response plan

If you discover a security vulnerability:

  1. Do not open a public GitHub issue
  2. Email security concerns to the maintainer
  3. Provide:
    • Description of the vulnerability
    • Steps to reproduce
    • Potential impact
    • Suggested fix (if any)

We take security seriously and will respond promptly.


When using cloud LLM providers:

Provider Data Usage Privacy Policy
OpenAI May use for training (opt-out available) Policy
OpenRouter Varies by model Policy
Local LLM No external transmission N/A

Recommendation: For sensitive content, use a local LLM.

Whisper transcription happens locally in the backend. Audio is:

  • Never sent to external services (unless using OpenAI API)
  • Processed in memory
  • Deleted after transcription completes

  1. Update regularly - Check for new releases
  2. Review changelogs - Note security fixes
  3. Monitor dependencies - Backend uses many libraries
  4. Follow announcements - Watch the GitHub repository
  • Security patches are prioritized
  • Critical fixes released ASAP
  • Regular updates include security improvements