From: Matt Caswell Date: Fri, 15 Mar 2024 17:58:42 +0000 (+0000) Subject: Hardening around not_resumable sessions X-Git-Tag: openssl-3.1.6~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c342f4b8bd2d0b375b0e22337057c2eab47d9b96;p=thirdparty%2Fopenssl.git Hardening around not_resumable sessions Make sure we can't inadvertently use a not_resumable session Related to CVE-2024-2511 Reviewed-by: Neil Horman Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/24044) --- diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c index 241cf43c462..5ce0d308c12 100644 --- a/ssl/ssl_sess.c +++ b/ssl/ssl_sess.c @@ -533,6 +533,12 @@ SSL_SESSION *lookup_sess_in_cache(SSL *s, const unsigned char *sess_id, ret = s->session_ctx->get_session_cb(s, sess_id, sess_id_len, ©); if (ret != NULL) { + if (ret->not_resumable) { + /* If its not resumable then ignore this session */ + if (!copy) + SSL_SESSION_free(ret); + return NULL; + } ssl_tsan_counter(s->session_ctx, &s->session_ctx->stats.sess_cb_hit);