Skip to content

Commit fb9fa6b

Browse files
Peter Kaestlemattcaswell
Peter Kaestle
authored andcommitted
ssl sigalg extension: fix NULL pointer dereference
As the variable peer_sigalgslen is not cleared on ssl rehandshake, it's possible to crash an openssl tls secured server remotely by sending a manipulated hello message in a rehandshake. On such a manipulated rehandshake, tls1_set_shared_sigalgs() calls tls12_shared_sigalgs() with the peer_sigalgslen of the previous handshake, while the peer_sigalgs has been freed. As a result tls12_shared_sigalgs() walks over the available peer_sigalgs and tries to access data of a NULL pointer. This issue was introduced by c589c34 (Add support for the TLS 1.3 signature_algorithms_cert extension, 2018-01-11). Signed-off-by: Peter Kästle <peter.kaestle@nokia.com> Signed-off-by: Samuel Sapalski <samuel.sapalski@nokia.com> CVE-2021-3449 CLA: trivial Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
1 parent 3ff3862 commit fb9fa6b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ssl/statem/extensions.c

+1
Original file line numberDiff line numberDiff line change
@@ -1139,6 +1139,7 @@ static int init_sig_algs(SSL *s, unsigned int context)
11391139
/* Clear any signature algorithms extension received */
11401140
OPENSSL_free(s->s3->tmp.peer_sigalgs);
11411141
s->s3->tmp.peer_sigalgs = NULL;
1142+
s->s3->tmp.peer_sigalgslen = 0;
11421143

11431144
return 1;
11441145
}

0 commit comments

Comments
 (0)