Skip to content

High-severity follow-ups: cap HPACK table, drain acceptor exits, harden TLS opts#3

Merged
benoitc merged 1 commit into
mainfrom
high-severity-followups
May 19, 2026
Merged

High-severity follow-ups: cap HPACK table, drain acceptor exits, harden TLS opts#3
benoitc merged 1 commit into
mainfrom
high-severity-followups

Conversation

@benoitc
Copy link
Copy Markdown
Owner

@benoitc benoitc commented May 19, 2026

Summary

Three independent High findings from the security/concurrency audit, surgical and unrelated:

  • Cap peer SETTINGS_HEADER_TABLE_SIZE at 64 KB before applying. RFC 7541 lets a peer advertise any 32-bit value; honoring it feeds the encoder dynamic table whose lookup is O(n), enabling CPU/memory exhaustion.
  • Drain queued {'EXIT', _, _} after every accept in the ssl and tcp acceptor loops. Acceptors run with trap_exit and spawn_link per connection wrapper, so every closed connection leaves an EXIT message that nobody reads; on a busy server the mailbox grows without bound.
  • Harden start_server TLS option building: extract build_server_ssl_opts/3, honor top-level verify (default verify_none), reject verify_peer without cacerts ({error, verify_peer_requires_cacerts}), accept an ssl_opts override list, and default honor_cipher_order to true.

All 92 tests pass.

…en TLS opts

Three independent High findings from the audit:

Cap peer SETTINGS_HEADER_TABLE_SIZE at 64 KB before applying. RFC 7541
lets a peer advertise any 32-bit value; honoring it verbatim feeds the
encoder dynamic table, whose lookup is O(n), turning a chatty peer into
a CPU/memory exhaustion vector.

Drain queued {'EXIT',_,_} after every accept in the ssl and tcp loops.
Acceptors run with trap_exit and spawn_link per connection wrapper, so
every closed connection leaves an EXIT message that nobody reads; on a
busy server the mailbox grows without bound and selective receives
degrade.

Harden start_server TLS option building: extract build_server_ssl_opts/3,
honor top-level `verify' (default verify_none), reject verify_peer
without cacerts (verify_peer_requires_cacerts), accept an ssl_opts
override list merged on top of the defaults, and default
honor_cipher_order to true.
@benoitc benoitc merged commit 436646c into main May 19, 2026
5 checks passed
@benoitc benoitc deleted the high-severity-followups branch May 19, 2026 12:57
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