Skip to content

Fix security review findings - #66

Merged
rthellend merged 1 commit into
mainfrom
security-fixes
Oct 7, 2026
Merged

rthellend merged 1 commit into
mainfrom
security-fixes

Conversation

@rthellend

Copy link
Copy Markdown
Contributor
  • Conn.Read: reject zero-length handshake records with unexpected_message instead of panicking with an out-of-range index. Any client could trigger the panic after a successful ECH handshake because ECH configs are public. Also guard the same index in inspectWrite and use its record argument.
  • processEncryptedClientHello: stop trial decryption after the first key that succeeds. Previously, a later key with the same config_id and cipher suite reused the advanced HPKE context, failed, and cleared the decrypted ClientHelloInner, silently rejecting ECH.
  • NewConn: evaluate err when the deferred alert conversion runs, not when the defer statement executes. Alerts were never sent and the connection was never closed on error.
  • Transport: update the NewTransport doc to reflect that plaintext HTTP is allowed unless RequireECH is set.
  • dns: limit decoded names to 255 octets and labels to 63 octets (RFC 1035 3.1) to bound memory use from compression pointer chains.

- Conn.Read: reject zero-length handshake records with unexpected_message
  instead of panicking with an out-of-range index. Any client could trigger
  the panic after a successful ECH handshake because ECH configs are public.
  Also guard the same index in inspectWrite and use its record argument.
- processEncryptedClientHello: stop trial decryption after the first key
  that succeeds. Previously, a later key with the same config_id and cipher
  suite reused the advanced HPKE context, failed, and cleared the decrypted
  ClientHelloInner, silently rejecting ECH.
- NewConn: evaluate err when the deferred alert conversion runs, not when
  the defer statement executes. Alerts were never sent and the connection
  was never closed on error.
- Transport: update the NewTransport doc to reflect that plaintext HTTP is
  allowed unless RequireECH is set.
- dns: limit decoded names to 255 octets and labels to 63 octets (RFC 1035
  3.1) to bound memory use from compression pointer chains.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rthellend
rthellend merged commit 1196efd into main Oct 7, 2026
4 checks passed
@rthellend
rthellend deleted the security-fixes branch October 7, 2026 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant