CVSROOT: /cvs
Module name: src
Changes by: [email protected] 2026/09/17 16:47:41
Modified files:
lib/libssl : d1_both.c
Log message:
Limit size of buffered DTLS handshake messages.
Fragments from out-of-sequence DTLS handshake messages are buffered for
reassembly. When a new out-of-sequence handshake message fragment is
received it will allocate the full message length buffer that would be
used by the fully reassembled message. This is limited to the next
10 messages in sequence, each capped to a maximum size of 128KB - a
further 16KB is allocated for each reassembly bitmap. A set of crafted
handshake message fragments can trigger allocation of 10 * 144KB
(128KB + 16KB), with 156 bytes on the wire.
Change dtls1_max_handshake_message_len() so that we limit handshake
messages to ~16KB, with the exception of a Certificate message, which
uses s->max_cert_list (128KB by default). Also ensure that we do not
currently have an identical handshake message type pending for
reassembly - this prevents resassembly of multiple Certificate messages
which would then result in the original allocations.
This caps the allocation to ~306KB (9 * ~18KB + 144KB) - the correct
long term fix is to avoid full allocation by only storing the fragments
received on the wire, until reassembly can be completed.
ok joshua@ kenjiro@ tb@