]> git.ipfire.org Git - thirdparty/openssl.git/commit
Fix unconstrained session cache growth in TLSv1.3
authorMatt Caswell <matt@openssl.org>
Tue, 5 Mar 2024 15:43:53 +0000 (15:43 +0000)
committerTomas Mraz <tomas@openssl.org>
Mon, 8 Apr 2024 10:09:42 +0000 (12:09 +0200)
commit7e4d731b1c07201ad9374c1cd9ac5263bdf35bce
tree6bd63b214c7934b94598316f1dd4d28e47815a8e
parent031b11a4054c972a5e2f07dfa81ce1842453253e
Fix unconstrained session cache growth in TLSv1.3

In TLSv1.3 we create a new session object for each ticket that we send.
We do this by duplicating the original session. If SSL_OP_NO_TICKET is in
use then the new session will be added to the session cache. However, if
early data is not in use (and therefore anti-replay protection is being
used), then multiple threads could be resuming from the same session
simultaneously. If this happens and a problem occurs on one of the threads,
then the original session object could be marked as not_resumable. When we
duplicate the session object this not_resumable status gets copied into the
new session object. The new session object is then added to the session
cache even though it is not_resumable.

Subsequently, another bug means that the session_id_length is set to 0 for
sessions that are marked as not_resumable - even though that session is
still in the cache. Once this happens the session can never be removed from
the cache. When that object gets to be the session cache tail object the
cache never shrinks again and grows indefinitely.

CVE-2024-2511

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24044)
ssl/ssl_lib.c
ssl/ssl_sess.c
ssl/statem/statem_srvr.c