Printing a `TLS.Config` exposes TLS session secrets in Reseau.jl
Description
Reseau.TLS.Config keeps the server's session-ticket keys and the client's cached TLS sessions in private fields.
These fields arrived with Reseau's native TLS stack in 1.1.0. Before 1.7.0, Config had no show method that left
them out, so show, print, repr, string and string interpolation of a config that had handled connections
printed the ticket keys' secret bytes and the cached sessions' secrets.
Reseau 1.7.0 prints only a config's public settings, and masks key_passphrase. Base.dump still prints every
field of any value.
Impact
An application that prints or logs a TLS.Config after it has handled connections writes these secrets to that
output. Anyone who can read the output can:
- Decrypt the session tickets that a server issued while the printed ticket keys were in use. A TLS 1.2 ticket carries the session's master secret, which decrypts recorded traffic of that session and of its resumptions. A TLS 1.3 ticket carries a resumption key that lets them resume the session as the client.
- Use a client's cached TLS 1.2 session secrets to decrypt recorded traffic of those sessions, and its TLS 1.3 resumption keys to resume those sessions as the client.
Reseau resumes TLS 1.3 sessions only with a new key exchange (psk_dhe_ke), so a TLS 1.3 secret does not decrypt
recorded traffic. Session tickets are on by default.
Patches
Fixed in Reseau 1.7.0. Upgrade to 1.7.0 or later.
Workarounds
Don't print or log a TLS.Config, or any value that contains one, on an affected version. Setting
session_tickets_disabled = true stops a server from issuing tickets. Reseau generates ticket keys at random and keeps
them only in memory, so restarting a process that may have logged a config discards its ticket keys and cached
sessions. Treat logs that may contain a printed config as holding secrets.