Input caps plus shutdown behavior
- Status: SHIPPED, all caps enforced with Gate 2 proof
- Spec: caps table, floors table, D-04, FR-06, FR-10, FR-12
- Sources:
tosv.cppparse plus store,archive/tosv.pyexit wipe,uploads/paste.txtvision, SPEC.md 0.3 and 0.4
What it is
Every unbounded input has a ceiling: 64KB headers, 512MB single blob, 100k blobs, 10k grants, 1000 sessions, login 5/300s, store 20/300s, 100MB audit with external rotation, 500MB log dir. And shutdown is boring by decision D-04: signals close the process with a log line and never wipe, because routine restarts must never delete and floors page humans instead.
How TOSV does it
The parser breaks past 64KB of headers, store checks
Content-Length against 512MB before crypting, grants refuse past
10k, sessions drop oldest past 1000, rates 429 past their windows.
Signal handlers call _exit after the OS-default cleanup. Legacy
Python instead wiped on SIGTERM/SIGINT plus atexit; the C++ port
changed this deliberately with recorded rationale.
What it protects against
Denial of service by giant inputs, disk-fill by unbounded logs, grant-table bloat, and the saddest outage class of all: the vault ate itself during a routine deploy restart.
Attack realism
Very high for caps (every public socket gets fuzzed with garbage sizes within hours) and high for shutdown (systemd restarts, OOM kills, and deploys all send the signals that legacy treated as tamper). Treating routine signals as attacks was the bug; D-04 is the fix.
Pros
Finite worst case for every resource. Restarts are safe to automate. Floors turn would-be silent deletions into human pages.
Cons and how the vault resolves them
- Caps can reject legit big drops with 413. Resolved by documenting the ceilings on the wizard page plus the grant reply, so the operator sizes drops before sending.
- No auto-wipe on tamper signal anymore. Resolved by scoping: genuine tamper response is the duress login (human-confirmed) plus future debugger and header-tamper detection, never a bare SIGTERM.
_exitskips graceful socket close. Accepted: connections are single-request plus close anyway; no state lives in the socket.- Legacy operators may expect signal wipe. Resolved by the D-04 rationale in SPEC plus this page: the change is loud, linked, and permanent unless a new ADR says otherwise.
Residual risk
None: caps plus boring shutdown compose fully with streaming and rate limits.
M6: 64 conn cap with 503, 30s recv timeout, 64KB form cap, chunked 501, catch-all 500 per request, 10k ATT cap, 0600 on env plus DB, no-store on all replies, fatal bind, port validation.