Description
The built-in session-ticket key path has a narrow concurrency window between automatic key rotation and an application call to SetSessionTicketKeys. A handshake can continue using stale automatic rotation state after manual keys have been installed.
This is not a Go data race and does not disclose ticket keys. The plausible impact is at most one stale or unusable ticket around the transition.
Specification or documentation
This is a Go API consistency issue. Config.SetSessionTicketKeys is documented as updating the keys used by the built-in session-ticket mechanism. New ticket encryption after the call should consistently reflect the manual key set.
Code references
go/src/crypto/tls/handshake_server_tls13.go:999 encrypts TLS 1.3 session ticket state with c.config.encryptTicket.
go/src/crypto/tls/common.go:1085 through go/src/crypto/tls/common.go:1138 implements Config.ticketKeys, including automatic key rotation and the lock upgrade path.
go/src/crypto/tls/common.go:1141 through go/src/crypto/tls/common.go:1166 implements SetSessionTicketKeys and documents that calling it turns off automatic session ticket key rotation.
go/src/crypto/tls/handshake_server_test.go:1672 has existing coverage around SetSessionTicketKeys.
Test case
This should be a deterministic Go unit test with a hook at the internal read-lock-to-write-lock transition in the automatic ticket-key rotation path. The hook can call SetSessionTicketKeys and then assert that the ticket-key path returns manual keys rather than continuing with automatic rotation.
Description
The built-in session-ticket key path has a narrow concurrency window between automatic key rotation and an application call to
SetSessionTicketKeys. A handshake can continue using stale automatic rotation state after manual keys have been installed.This is not a Go data race and does not disclose ticket keys. The plausible impact is at most one stale or unusable ticket around the transition.
Specification or documentation
This is a Go API consistency issue.
Config.SetSessionTicketKeysis documented as updating the keys used by the built-in session-ticket mechanism. New ticket encryption after the call should consistently reflect the manual key set.Code references
go/src/crypto/tls/handshake_server_tls13.go:999encrypts TLS 1.3 session ticket state withc.config.encryptTicket.go/src/crypto/tls/common.go:1085throughgo/src/crypto/tls/common.go:1138implementsConfig.ticketKeys, including automatic key rotation and the lock upgrade path.go/src/crypto/tls/common.go:1141throughgo/src/crypto/tls/common.go:1166implementsSetSessionTicketKeysand documents that calling it turns off automatic session ticket key rotation.go/src/crypto/tls/handshake_server_test.go:1672has existing coverage aroundSetSessionTicketKeys.Test case
This should be a deterministic Go unit test with a hook at the internal read-lock-to-write-lock transition in the automatic ticket-key rotation path. The hook can call
SetSessionTicketKeysand then assert that the ticket-key path returns manual keys rather than continuing with automatic rotation.