# Loopback plus stunnel, TLS research - Status: SHIPPED loopback bind, stunnel runbook written - Spec: SEC-08, OPS-01, PIN-06, PIN-07 - Sources: `tosv.cpp` main bind, `archive/tosv.py` loopback bind, tasks research report plus notes, SPEC.md 5 and 9 ## What it is The binary speaks plaintext HTTP on 127.0.0.1 only; remote access rides through a stunnel front that the operator owns. Zero TLS code in the vault means zero TLS bugs in the vault. The research track already ranked the in-binary future: mbedTLS default, BearSSL fallback, wolfSSL only paired with commercial wolfSSH, OpenSSL rejected as overkill. ## How TOSV does it `main` binds the pinned loopback address and prints the bind line (the legacy C++ bound all interfaces while printing loopback; M1 fixes that exact drift). Stunnel config and cert steps land as the M4 runbook. License rules are pre-decided: Apache/MIT stacks link freely, LGPL libssh needs notice plus relink offer, GPL wolf builds need a commercial license for closed ships. ## What it protects against Network eavesdropping and credential sniffing (nothing vault-shaped crosses a wire unencrypted except loopback, which has no wire), and TLS-library CVE exposure in the vault process itself. ## Attack realism High. The realistic deploy is a VPS with stunnel plus firewall; that stack is decades old and boring in the best way. Realism limit: loopback HTTP is visible to local root and containers sharing the net namespace, which is accepted because those attackers already own the process. ## Pros Smallest possible network bug surface. Battle-tested TLS at the edge. Researched upgrade path with scored candidates and license landmines already mapped. ## Cons and how the vault resolves them - Plaintext on loopback. Accepted with open eyes: the threat model names local root as game-over everywhere (see [memory](sec-memory.md)); adding in-binary TLS would not move that line one inch. - Extra remote-access setup. Resolved by the stunnel runbook plus cert steps, drilled 2026-10-31 against real stunnel 5.77 with a 302 login over TLS; the operator does setup once per vault. - Legacy bind-all drift. Resolved by PIN-06 plus a Gate 2 smoke asserting the bind line says 127.0.0.1. - No TLS 1.3 inside yet. Resolved by stunnel today (modern TLS at edge) and the ranked mbedTLS plan for the in-binary future, see [future netops](sec-future-netops.md). ## Residual risk Shared-net-namespace container snooping on loopback. Mitigated by deploy guidance (dedicated namespace or unix-socket future work). M6: every reply carries Cache-Control: no-store, asserted on login plus fetch. ## See also - [Security index](security.md), [session](sec-session.md), [future netops](sec-future-netops.md), [dav](sec-dav.md)