_Found via a CodeRabbit deep-scan, validated against current `main`. Part of a six-issue security batch (SEC-06) — five independent small hardening items in one PR._ ## Summary 1. **Postgres sslmode silently downgrades to plaintext** (`src/storage/postgres/config.ts`). Only `disable` and `require` are handled; `PGSSLMODE`/`sslmode=` values `prefer`, `allow`, `verify-ca` and `verify-full` fall through to `ssl: false` — an operator asking for *verified* TLS gets plaintext. 2. **No HTTPS path for remote hook-spool ingest.** `buildWorkerUrl` (`src/shared/worker-utils.ts`) hard-codes `http://`; a user pointing hook spooling at a remote worker without a tunnel ships event content plus the `Authorization` bearer in cleartext. 3. **WebSocket auth never expires after upgrade** — in both sync implementations (`workers/sync-hub/src/do/SyncHub.ts` and `services/sync-api/src/store.ts`/`sockets.ts`). The socket retains only `{ device_id }` and `fanOutCommitted` pushes full op bodies with no re-auth, so a revoked or expired token keeps receiving synced content until disconnect. 4. **README translation runs with full tool authority** (`scripts/translate-readme/index.ts`). Document content is interpolated into a `bypassPermissions`/`allowDangerouslySkipPermissions` query with no tool restriction — injected instructions in a README could drive arbitrary local tool use. (`allowedTools` is an auto-approve list in this codebase, not a restriction; `tools: []` is the real lockdown.) 5. **Hermes tag-scanner ReDoS** (`hermes/claude-mem/client.py`). `_TAG`'s `[^>]*` tail lets every unfinished `<tagname` candidate scan to end-of-string — O(n²) on adversarial input. ## Suggested fix Honor all six `sslmode` values with libpq precedence (URL param over `PGSSLMODE`); add a `CLAUDE_MEM_WORKER_URL` `http(s)`-only override that also marks spooling remote; stamp each socket with an auth deadline bounded by the verdict-cache TTL and close expired sockets with `4401` instead of feeding them; run translation with `tools: []` + deny list; bound the regex tail.