BeachViber routes remote commands to Claude Code on your machine. That power demands an architecture where security is the foundation, not an afterthought.
The cloud relay is treated as an untrusted intermediary. It routes encrypted payloads it cannot decrypt. A fully compromised relay learns nothing about your code.
When the approval system is unreachable, all tool executions are denied. No timeouts that default to "allow". No silent failures. Absence of approval = denial.
Only read-only tools auto-approve. Every tool that writes files, executes commands, or has side effects requires explicit human approval from your phone.
BeachViber uses Claude Code's built-in tool permission system — the same one already running on your desktop. We never use --dangerously-skip-permissions. Ever.
Complete system diagram showing encryption boundaries, trust zones, and data flow between all components.
Multiple layers of authentication protect user accounts and device registration.
All encryption uses the NaCl (Networking and Cryptography library) via TweetNaCl.js, a minimal, audited, zero-dependency implementation.
The tool approval system is the critical security boundary between Claude Code's capabilities and your machine. BeachViber works within Claude Code's existing permission model — we never bypass it with --dangerously-skip-permissions.
These tools cannot modify your system and are approved automatically by the desktop agent:
These tools have side effects and require explicit approval from your phone before execution:
CORS restricted to process.env.WEBAPP_URL only. No wildcard origins. Prevents cross-origin attacks from malicious sites.
Strict CSP headers limit script sources, connection endpoints, and frame embedding. X-Frame-Options: DENY prevents clickjacking.
Pairing codes, verification codes, and temporary records auto-expire via DynamoDB TTL. No stale sensitive data persists in the database.
All API inputs validated with zod schemas at the boundary. Strict type checking prevents injection and malformed data from reaching handlers.
TLS certificate verification enabled on all outbound connections. No certificate pinning bypass. HTTPS enforced for all API and WebSocket traffic.
All debug logging removed from production. No secrets, tokens, keys, or sensitive data written to logs. Console output sanitized.
Ongoing security hardening with tracked issues. Critical and high-priority items are resolved.
| Category | Issue | Status |
|---|---|---|
| CRITICAL | Approval hook fails closed (deny when unreachable) | Fixed |
| CRITICAL | TLS certificate verification enabled | Fixed |
| CRITICAL | OAuth state parameter timing-safe validation | Fixed |
| CRITICAL | Timing-safe comparisons for all secret values | Fixed |
| CRITICAL | Relay messages wrapped in typed envelope | Fixed |
| CRITICAL | Secrets stored with restrictive file permissions | Fixed |
| HIGH | Password reset invalidates all sessions | Fixed |
| HIGH | JWT algorithm pinned to HS256 | Fixed |
| HIGH | GitHub OAuth no auto-link by email | Fixed |
| HIGH | Atomic refresh token rotation | Fixed |
| HIGH | CORS hardened to specific origin | Fixed |
| HIGH | CSP meta tag + X-Frame-Options DENY | Fixed |
| HIGH | Verification codes use CSPRNG | Fixed |
| HIGH | Account enumeration prevention | Fixed |
| HIGH | Unix socket TOCTOU fixed with umask | Fixed |
TweetNaCl is a minimal, audited, constant-time implementation with zero dependencies. It provides the exact primitives we need (box/unbox) without the complexity and footgun potential of the Web Crypto API. The library is small enough to audit in a single sitting.
Unix domain sockets provide kernel-enforced access control (UID-based), have no network attack surface, and are cleaned up by the OS. They're the most secure IPC mechanism available for same-machine communication between the agent and Claude Code hook.
Compromising one project's keypair doesn't compromise others. Each pairing gets its own X25519 keypair, stored in a separate config file with 0600 permissions. This limits the blast radius of any single key compromise.
The tool approval system controls execution of arbitrary shell commands on your machine. The safe default for a system this powerful is always denial. If we can't reach you to ask permission, we don't act.
Claude Code's CLI has a flag that bypasses all tool permission checks. BeachViber never uses it. Instead, we layer on top of Claude Code's existing permission system — the same one you already trust on your desktop. Your machine, your permissions, no shortcuts.