A memory leak can occur in dtls1_buffer_record if either of the calls to
authorMatt Caswell <matt@openssl.org>
Wed, 7 Jan 2015 14:18:13 +0000 (14:18 +0000)
committerMatt Caswell <matt@openssl.org>
Thu, 8 Jan 2015 15:49:45 +0000 (15:49 +0000)
commit103b171d8fc282ef435f8de9afbf7782e312961f
treea0c344a63662e2b784f57a901be3c3fb4d11cd34
parent1421e0c584ae9120ca1b88098f13d6d2e90b83a3
A memory leak can occur in dtls1_buffer_record if either of the calls to
ssl3_setup_buffers or pqueue_insert fail. The former will fail if there is a
malloc failure, whilst the latter will fail if attempting to add a duplicate
record to the queue. This should never happen because duplicate records should
be detected and dropped before any attempt to add them to the queue.
Unfortunately records that arrive that are for the next epoch are not being
recorded correctly, and therefore replays are not being detected.
Additionally, these "should not happen" failures that can occur in
dtls1_buffer_record are not being treated as fatal and therefore an attacker
could exploit this by sending repeated replay records for the next epoch,
eventually causing a DoS through memory exhaustion.

Thanks to Chris Mueller for reporting this issue and providing initial
analysis and a patch. Further analysis and the final patch was performed by
Matt Caswell from the OpenSSL development team.

CVE-2015-0206

Reviewed-by: Dr Stephen Henson <steve@openssl.org>
ssl/d1_pkt.c