trust on first use

term

securitycryptography

Kept in this browser · My desk

Stands for: TOFU

A trust model in which a client accepts an identity, a key or a policy the first time it meets it, without independent proof, stores it, and holds the other side to it on every later connection.

It is how SSH clients commonly treat host keys, how an HSTS header protects a site from the second visit on, and how Android 13 lets users join enterprise Wi-Fi without a preinstalled certificate authority. RFC 7435 defines it and states its weakness: it does 'not protect against an attacker who can hijack the first contact communication'. The cures replace the first contact with something prepared in advance: a fingerprint checked out of band, a browser preload list, a managed certificate profile.

Definition. RFC 7435, 'Opportunistic Security: Some Protection Most of the Time' (Viktor Dukhovni, Informational, December 2014), defines it: 'TOFU calls for accepting and storing a public key or credential associated with an asserted identity, without authenticating that assertion. Subsequent communication that is authenticated using the cached key or credential is secure against an MiTM attack, if such an attack did not succeed during the vulnerable initial communication'. It adds that 'The SSH protocol [RFC4251] in its commonly deployed form makes use of TOFU', that 'leap of faith' is sometimes used as a synonym, and that TOFU 'can make it difficult to distinguish routine key management from a malicious attack', since a legitimate key change looks like an impostor.

SSH, the classic case. RFC 4251 (Tatu Ylonen and Chris Lonvick, January 2006) allows 'that the server name - host key association is not checked when connecting to the host for the first time', which still protects against passive listening but 'becomes vulnerable to active man-in-the-middle attacks'; it says implementations 'SHOULD NOT normally allow such connections by default' but accepts the option because 'there is no widely deployed key infrastructure', and recommends the TOFU pattern itself: 'only accept a host key without checking the first time a host is connected, save the key in a local database, and compare against that key on all future connections', with fingerprints that 'can easily be verified by using telephone or other external communication channels'.

HSTS. An HSTS header is TOFU for a security policy: a browser that has seen it over a valid HTTPS connection refuses plaintext and certificate errors for that host until max-age expires. RFC 6797 names the first-contact weakness the 'Bootstrap MITM Vulnerability' (14.6): a first visit 'using an http URI' is open to stripping. Its remedy, the pre-loaded list (12.3), removes the first use altogether by shipping the policy in the browser.

Wi-Fi. Enterprise Wi-Fi authenticates the network by its server certificate, which the client must check against a trusted root and name. Android's documentation records the path from no checking to TOFU: until Android 11 users could pick 'Do not validate'; 'to strengthen security and comply with the WPA R2 specification, Android 12 introduced a requirement for enterprise networks to have server certificate validation', and apps on Android 11 QPR1 and later must supply a root CA and a domain suffix or alternate subject match. Because that made joining networks harder, Android 13 added TOFU, citing RFC 7435: on first connection the user sees a dialog asking whether the network is trusted, and the device keeps the accepted root CA and domain for later connections. An evil twin present at that first connection wins it, which is why managed profiles that pin the root and name remain the stronger choice.

Android's TOFU in operation. For a new enterprise network chosen in the Wi-Fi picker, a device that supports TOFU shows a dialog; 'Yes, connect' makes it configure the security parameters, connect and enable auto-connect, while 'No, don't connect' disconnects and disables auto-connect. For a saved network with auto-connect but no valid CA certificate, the device 'connects automatically, then displays a sticky (nondismissable) notification' leading to the same dialog. Misconfigured networks with invalid or expired certificates 'might not allow any security validation by the device', and the device then fails to connect. RFC 7435 frames all such designs: opportunistic and first-use security trade some protection for deployability, and 'require more care from the end user when systems update their cryptographic keys'.

What goes wrong, and neighbours. TOFU fails exactly where attackers concentrate: first visits on hostile networks, new devices, freshly reinstalled clients, and key rotations that train users to click through. It sits beside certificate pinning, HSTS and its preload list, SSH host keys, 802.1X server validation, and opportunistic encryption such as Wi-Fi Enhanced Open, which skips identity altogether.

Also known as: tofu, bootstrap mitm, leap of faith, confiança no primeiro uso

← Back to T Back to the glossary