# Time-window gating - Status: SHIPPED in C++ port - Spec: SEC-06, FR-03, FR-05 - Sources: `tosv.cpp` fetch window check, `archive/tosv.py` legacy, `uploads/paste.txt` vision, SPEC.md 3 ## What it is Grants carry optional `frm` and `to` bounds in `%FT%H:%M` UTC, compared as strings against current UTC on every fetch. Before `frm` gives `too early`, after `to` gives `expired`, empty bound means open. Access dies on its own: no revocation run needed. ## How TOSV does it The fetch handler formats `gmtime` once per request and string compares, which is exact for zero-padded UTC stamps. The wizard takes `datetime-local` inputs and stores them raw; legacy Python parsed ISO with tzinfo, the C++ port keeps the simpler string compare and documents UTC as the only zone. ## What it protects against Eternal leaks: every forwarded cred eventually rots. It bounds incident response too: past-`to` grants need no emergency revoke. ## Attack realism Very high for the stated use (collect data once, use once, never again). Time-boxed drops are the product. Realism limit is clock trust: a fetcher who controls the vault clock controls the window, so the clock must be the operator's, guarded in v2 by NTP skew checks (see [future platform](sec-future-platform.md)). ## Pros Self-expiring, zero cleanup. Distinct `too early` versus `expired` replies aid legit users without aiding attackers (both reveal only that a window exists, which the grant page already showed). String compare has no parser bugs. ## Cons and how the vault resolves them - VM clock skew shifts bounds. Landed in M5 as a fail-open guard: hourly SNTP check audits past 60s; see [clock guard](sec-clock.md). Enforcement stays a v2 option with its own ADR. - Minute granularity, no seconds. Accepted: vault drops measure in hours and days; finer grains add UX pain for zero threat gain. - Operator timezone confusion. Resolved by UTC-everywhere rule plus wizard labels; the grant page echoes stored bounds back for a visual check. - Legacy ISO parse accepted offsets. Changed deliberately: one zone, one format, no parser. The C++ behavior is the pinned one. ## Residual risk Host clock compromise. Tracked under NTP guard; a root-owned clock means a root-owned box anyway. M6: strict window-format validation with 400 on garbage. ## See also - [Security index](security.md), [IP gate](sec-ip-gate.md), [grant creds](sec-grant-creds.md), [future platform](sec-future-platform.md)