diff --git a/Changes.rst b/Changes.rst index 3dba7e0e..734ef731 100644 --- a/Changes.rst +++ b/Changes.rst @@ -327,3 +327,11 @@ Bugfixes -------- - Fix memory leak introduced in 2.4.1: if --remote-cert-tls is used, we leaked some memory on each TLS (re)negotiation. + +Security +-------- +- Fix a pre-authentication denial-of-service attack on both clients and servers. + By sending a too-large control packet, OpenVPN 2.4.0 or 2.4.1 can be forced + to hit an ASSERT() and stop the process. If ``--tls-auth`` or ``--tls-crypt`` + is used, only attackers that have the ``--tls-auth`` or ``--tls-crypt`` key + can mount an attack. (OSTIF/Quarkslab audit finding 5.1, CVE-2017-7478) diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c index 5f290fef..21c9d6f7 100644 --- a/src/openvpn/ssl.c +++ b/src/openvpn/ssl.c @@ -3720,7 +3720,12 @@ tls_pre_decrypt(struct tls_multi *multi, /* Save incoming ciphertext packet to reliable buffer */ struct buffer *in = reliable_get_buf(ks->rec_reliable); ASSERT(in); - ASSERT(buf_copy(in, buf)); + if(!buf_copy(in, buf)) + { + msg(D_MULTI_DROPPED, + "Incoming control channel packet too big, dropping."); + goto error; + } reliable_mark_active_incoming(ks->rec_reliable, in, id, op); }