Skip to content

tls: fix out-of-bounds read in ClientHelloParser

Rodrigo Muino Tomonari requested to merge github/fork/tniessen/h1-1690368 into main

ClientHelloParser::ParseHeader(data, avail) potentially accesses data beyond avail bytes because it trusts the client to transmit a valid frame length. Sending an impossibly small frame length causes the TLS server to read beyond the buffer provided by the caller.

Guard against this by calling End() on the ClientHelloParser when the client transmits an impossibly small frame length.

The test is designed to reliable cause a segmentation fault on Linux and Windows when the buffer overrun occurs, and to trigger a spatial safety violation when compiled with an address sanitizer enabled or when running under valgrind.

Merge request reports

Loading