Security Model
Tallow is built with a security-maximalist approach. Every layer is designed to protect your data, even against future quantum computers.
Threat Model
Assets Protected
| Asset | Protection |
|---|---|
| File content (plaintext) | AES-256-GCM encryption, never leaves your device unencrypted |
| Key material | Zeroized on drop on every lane; on native builds (relay and CLI) pinned in RAM via mlock and never swapped to disk |
| Metadata (filenames, sizes, file tags) | Filenames and sizes encrypted in transit; EXIF/GPS and document metadata can be stripped before send (opt-in, off by default) |
| Identity (who communicates) | Optional Tor anonymity layer (SOCKS5 proxy) |
Metadata stripping is opt-in and off by default (the switch lives in
settings). Turned on, the browser strips metadata from strippable files: images
are redrawn through a canvas, discarding EXIF, GPS, XMP and IPTC; PDFs have
Title, Author, Subject, Keywords, Producer and Creator cleared; Office files
(.docx/.xlsx/.pptx) have their docProps metadata zeroed. It is off by
default because it is not lossless for images — a stripped JPEG/WebP is
re-encoded at quality 0.95, and the file you send is the rewritten one. Files
whose type is not strippable are sent unchanged, and a file that fails to strip
is sent as-is rather than blocking the transfer.
Trust Boundaries
- Client to Relay: The relay is fully untrusted. It only sees ciphertext and one-way room identifiers — never the room code itself, and never plaintext. Even a compromised relay cannot read your files, because every transfer is end-to-end encrypted before it reaches the relay.
- Client to Tor: Tor provides IP anonymity only. Tallow’s encryption is independent of Tor.
- Client to Client: Authenticated via PAKE (password-authenticated key exchange) and safety numbers.
Adversary Profiles
| Adversary | Capability | Mitigation |
|---|---|---|
| Shared WiFi attacker | Passive packet capture | E2E encryption, TLS on relay connection |
| Compromised relay | Full server control | Zero-knowledge design, E2E encryption |
| Nation-state (passive) | Backbone taps, metadata collection | Tor integration, traffic padding (both opt-in — see Traffic padding) |
| Nation-state (active) | DNS/BGP hijack, quantum computers | Post-quantum KEM, DoH, certificate pinning |
Cryptographic Algorithms
Key Exchange: Hybrid ML-KEM-1024 + X25519
Tallow uses a hybrid key encapsulation mechanism combining:
- ML-KEM-1024 (FIPS 203) — Post-quantum lattice-based KEM at Security Level 5, protecting against future quantum computers with a 15-year threat horizon
- X25519 (RFC 7748) — Classical elliptic-curve Diffie-Hellman, well-studied with constant-time implementations
Both algorithms must be broken to compromise the key exchange. This provides security against both classical and quantum adversaries.
Symmetric Encryption: AES-256-GCM
- 256-bit keys derived via HKDF-SHA256
- Counter-based 96-bit nonces (guaranteed unique, no birthday bound)
- Additional authenticated data (AAD) binds chunk index to prevent reordering
- Hardware-accelerated via AES-NI on supported platforms
Forward secrecy is scoped by lane. One file transfer derives a single 32-byte AES-256-GCM session key from the hybrid handshake and uses it for the whole transfer, with each chunk’s index bound into the AAD. There is no per-chunk or per-message re-keying on the file lane, so no forward secrecy is claimed beyond the lifetime of that transfer session — it is a bounded, ephemeral session. The key is one-shot and is zeroized and destroyed when the session ends. Per-message post-quantum forward secrecy is a property of the ratchet chat path only — see Chat.
Hashing: BLAKE3
- Primary hash function for integrity verification
- Merkle tree construction for file integrity — verified on the CLI transfer lane (receiver rebuilds the tree and compares roots); the browser sender does not send a Merkle root today, so the web lane rests on the per-chunk AES-GCM tags plus the transport
- Faster than SHA-256, parallelizable
- SHA3-256 used only where NIST compliance is specifically required
Password Hashing: Argon2id
- Memory-hard function resistant to GPU/ASIC attacks
- Parameters (per profile): Interactive — 3 iterations, 256 MiB, 4 lanes; Room (room-code derivation, wasm-safe) — 3 iterations, 64 MiB, 1 lane
- Used for deriving encryption keys from passwords and room codes
Signatures: Ed25519 + ML-DSA-87
- Hybrid signature scheme for identity verification
- Ed25519 for classical security
- ML-DSA-87 for post-quantum security
- Used for key rotation records and identity authentication
Transport & Certificates
- TLS 1.2/1.3 only, AEAD cipher suites, forward secrecy; the TLS 1.3 handshake negotiates the X25519MLKEM768 post-quantum hybrid
- Certificates are Let’s Encrypt (Caddy-managed ECDSA P-256, CT-logged); certificate transparency is monitored daily
- No OCSP stapling is served (Let’s Encrypt has deprecated OCSP); revocation relies on short-lived certificates plus CT monitoring
Memory Safety
- Rust — No buffer overflows, use-after-free, or data races
- Zeroize — All key material is securely wiped on drop using the
zeroizecrate, on every lane, including the browser’s WebAssembly engine - mlock — native builds only — In the relay and the CLI, secrets are pinned in RAM and never swapped to disk
- Core dumps disabled — native builds only —
prctl(PR_SET_DUMPABLE, 0)for the relay and CLI processes on Linux - Browser (WebAssembly) — keys live in the engine’s linear memory and are zeroized on drop. Paging and crash capture belong to the browser, not to the page, so the memory-pinning and dump-suppression controls named above are properties of the native builds and are not claimed here.
- Constant-time operations — Secret-dependent comparisons use the
subtlecrate, constant-time in native builds. Two limits stated rather than implied: in the browser build those guarantees are best-effort through the WebAssembly engine, and our own compositions (the PAKE, room-id derivation, ratchet and SAS) have not been through a timing harness. The one place a comparison of a secret-shaped value is not constant-time is a LAN discovery match (tallow-net/src/discovery/lan.rs), which is not an authentication check. - No unsafe —
#![forbid(unsafe_code)]in all crates except where explicitly required with documented SAFETY justifications
Browser Hardening
- Hash-locked scripts — the Content Security Policy’s
script-srcis an explicit list:'self','wasm-unsafe-eval', and one SHA-256 hash per inline script the build emits. There is no'unsafe-inline'and no'unsafe-eval'inscript-src('unsafe-inline'appears only instyle-src, where it cannot run script). The hash set is produced bywebsite/src/integrations/csp-hash.mjsat everyastro build: it scans the built HTML for inline<script>blocks, SHA-256s each one, and substitutes the sorted list into every page’s<meta>policy and into the Caddy-importable header atwebsite/deploy/csp-header.txt— the same list in both places, so the edge and the meta tag cannot drift. The committed header currently carries 37 such hashes (grep -o "sha256-[A-Za-z0-9+/=]*" deploy/csp-header.txt | wc -l); the count tracks the built HTML, not a fixed number. A script that is not in that list cannot execute, so injected markup cannot run script even if it reaches the DOM. This SHA-256 is a third, separate use from the artifact digests: the package checksum is plain SHA-256 inpkg/CHECKSUM.sha256, and the manifest’swasmHash/jsHashare SHA-384 SRI — all three are documented on Reproducible Builds. - Trusted Types: not shipped, and not claimed. No route carries
require-trusted-types-for 'script'. It was enabled on the marketing layout on 2026-10-09 and withdrawn the same day: every public page mounts the same client-side router, whose page swap parses the fetched document throughDOMParser.parseFromString, and the directive blocks that sink. The failure is silent — no console error, navigation simply degrades to full page loads. Enforcing it would have cost client-side navigation on every public page, so the substitution below was accepted instead (operator ruling, 2026-10-13). The directive was also not left dangling in an unserved layout: it and its DOMPurifydefaultpolicy were deleted on 2026-10-14, because a control no page enforces reads as one that does. - No DOM sink to inject into — no source file we author builds HTML from a string: no
innerHTML/outerHTML/insertAdjacentHTML, nocreateContextualFragment, nodocument.write, noeval/new Function, nocreateElement('script').scripts/dom-sink-check.py --strict, wired intoscripts/site-build.sh, enforces that against an empty baseline overwebsite/src, so a new sink there fails the build rather than being grandfathered in. The scope is exact and worth stating: that scan covers the source this repo authors, not the compiled bundle. The built output additionally contains vendored dependency code that does use these sinks internally — Astro’s client router (_astro/ClientRouter….js: 4×innerHTML, 1×insertAdjacentHTML) and the component runtime (_astro/client….js: 6×innerHTML, 14×dangerouslySetInnerHTML), both served asscript-src 'self'rather than hash-listed. That code is not ours to strip; the router’s input is the same-origin document this site serves, and what contains the class is the CSP above (no'unsafe-inline', no'unsafe-eval', every inline script hash-locked). The last sink of our own — this site’s own status page building its rows as an HTML string — was rewritten ontocreateElement/textContenton 2026-10-14; the rendered page is unchanged.
Relay Zero-Knowledge Design
The relay server is designed to know as little as possible:
- It receives a room code (a one-way, memory-hard Argon2id derivation of the passcode) — not the passcode itself
- It forwards encrypted bytes between participants — it cannot decrypt them
- It stores no transfer data or ciphertext — rooms and streams exist only in memory and expire. Nothing about an admission outlives the room: the exchange audit that used to write keyed 8-hex peer and room hashes is switched off (
audit.enabled = false), the process writes no journal lines, and TURN writes no session log. The peer-hash key is still held 0600 in a tmpfs directory recreated at every relay start, and is used for rate-limit bucketing that never reaches disk. - Rooms automatically expire after a configurable timeout (default 10 minutes)
- Rate limiting prevents abuse without requiring identity
A compromised relay has nothing to hand over: session keys are ephemeral, derived per session and held only in the participants’ memory, and the relay stores no ciphertext to disk. That is a statement about what the relay holds — checkable against its code and configuration — not a promise that no one can ever decrypt anything.
Optional: Tor / Onion Access
Tallow’s site and relay are also reachable as a Tor v3 onion service, for users who want to route around IP-level observation entirely:
- Onion address:
xmizmujadxbapmh5lhidxjux3v4e4efm45fgpqfwlgd5tcdv2zwrktad.onion - The onion serves the app and the relay from a single origin — the page routes its own relay traffic, so nothing leaves the tor circuit.
- Pages loaded from the onion automatically enter tor-mode: no WebRTC (no IP-bearing ICE candidates), no WebTransport, and scaled timeouts for circuit latency.
- Nothing is required. The clearnet site and relay are fully functional without Tor; the onion is strictly an opt-in alternative for users who choose it.
STRIDE Analysis
| Category | Threat | Mitigation |
|---|---|---|
| Spoofing | Impersonation | PAKE authentication, safety numbers |
| Tampering | Data modification | Per-chunk AEAD authentication tags, plus whole-file Merkle verification on the CLI lane |
| Repudiation | Denial of action | Not a design goal (privacy tool) |
| Information Disclosure | Data leakage | E2E encryption, zeroization, secure memory |
| Denial of Service | Resource exhaustion | Rate limiting, resource caps |
| Elevation of Privilege | Sandbox escape | OS sandbox (Landlock + Seccomp on Linux) |
Operational hardening evidence
The guarantees above name concrete operating-system controls. Everything in this section describes the native builds — the relay host and the CLI. The browser client has no equivalent controls: it runs inside the browser’s own memory management, and the browser decides paging and crash capture (see Browser Hardening).
The artefacts below are what makes each native control checkable: each claim has a published source or an explicit statement of where the artefact lives (audit rows A09-24…A09-30).
Core dumps disabled — native builds (row A09-25) — kernel and container layer:
kernel.core_pattern = |/bin/falsefs.suid_dumpable = 0kernel.kptr_restrict = 2# prod relay image (native) — no core dumps, no ptrace into the processRUN echo "ulimit -c 0" >> /etc/profile.d/no-core.shThe relay — a native build — additionally calls prctl(PR_SET_DUMPABLE, 0) at
startup, so even a root-invoked gcore on the running process produces nothing.
Key material never reaches swap — native builds (row A09-26):
# /etc/sysctl.d/61-tallow-swap.conf (paired with mlock in the relay and CLI)vm.swappiness = 0In native builds (relay and CLI) secrets are pinned with mlock/mprotect
in-process (see Memory Safety above). Where such a host cannot disable swap, the
swap device must be encrypted — documented as the deployment precondition rather
than assumed away.
No crash reporters (row A09-27): “We run no crash reporters. Period.”
Neither the relay nor the web application links a Sentry/Bugsnag-class SDK, and
no crash path uploads memory context. This is a statement of fact about the
build, verifiable by inspecting the dependency tree (cargo tree, pnpm ls).
Structured, allowlist-only logs (row A09-28): the log schema is exactly the
field set published on Transparency —
timestamp, method, path, status, latency, bytes. The LogSafe proc-macro
that makes unsafe fields a compile error lives in the relay repository;
publishing its source is pending the source-repository release (D-03 /
crypto register), and the field allowlist is the part that is published today.
IP stripping and X-Forwarded-For: which process reads it (row A09-29). Two different processes sit behind that edge, and the rule is different for each — stating the split is the point:
- The static site application never reads
X-Forwarded-For. Caddy terminates TLS and writes the access log on the origin host; the log format deletesremote_ip,client_ip,remote_portand theX-Forwarded-For/X-Real-Ip/Cf-Connecting-Ip/Referer/Cookierequest headers at the encoder (see thelogblock in the site’s Caddyfile underdeploy/caddy/). There is no CDN and no WAF in front of the origin — the apex and the relay resolve straight to the host that runs Caddy — so the stripped encoder is the only place an address could have been written. - The relay does read
X-Forwarded-For— to key its rate limits. The relay is a separate listener behind Caddy: every socket peer the relay sees is Caddy’s loopback address, so keying per-IP rate limits on the socket peer would collapse all clients into one bucket.crates/tallow-relay/src/client_ip.rstherefore takes the rightmostX-Forwarded-Forentry (falling back toX-Real-IP) when — and only when —trust_proxyis set and the direct peer is a loopback address. Left-hand entries are client-supplied and ignored; headers from a non-loopback peer are never consulted. The resolved address is used for rate-limit buckets (main WebSocket, presence socket, TURN credential mint) and nothing else: with the exchange audit off and the unit writing no journal lines, the peer-hash token it keys never reaches a log.
So: the relay reads the header for rate-limit identity and nothing else; the
application never reads it at all. Self-hosting the relay is what makes
trust_proxy your decision — see Self-Hosting.
The integration test that asserts the application path never consumes
X-Forwarded-For is a relay-repository artefact — not published here,
because it lives outside the website mandate (D-20); the invariants themselves are
what the IP addresses (site access log) and Client address (relay) rows of the
transparency table assert.
Rate limiting by proof-of-work (row A09-30): the challenge spec and the target relay configuration are published at Rate Limits (Proof-of-Work); the relay-side migration off IP keying is tracked in the crypto register (pending, not silently assumed).