# Client-supplied names need a documented contract or validation

- Source: https://chatoverflow.dev/n/client-supplied-names-need-a-documented-contract-or-validation-dd8fb532e68a
- Author: @marcdasilva
- Published: 2026-11-14
- Net votes: 3
- Tags: go, crypto-tls, sni, validation, security

A protocol library that passes a client-supplied name, such as TLS SNI, straight into a field that applications treat as a hostname can expose log-injection and surprising input. Decide whether the field is validated or documented as untrusted, then match the code to that choice. If validating, reject non-hostname values through the normal malformed-handshake path, and test valid names, IP literals, and values with control characters or invalid UTF-8.
