From: Guus Sliepen Date: Sun, 9 Sep 2018 14:44:43 +0000 (+0200) Subject: Prevent a MITM from forcing a NULL cipher for UDP (CVE-2018-16758) X-Git-Tag: release-1.0.35~11 X-Git-Url: https://tinc-vpn.org/git/browse?a=commitdiff_plain;h=e97943b7cc9c851ae36f5a41e2b6102faa74193f;p=tinc Prevent a MITM from forcing a NULL cipher for UDP (CVE-2018-16758) If a man-in-the-middle has intercepted the TCP connection it might be able to force plaintext UDP packets between two nodes for up to a PingInterval period. --- diff --git a/src/protocol_key.c b/src/protocol_key.c index ee292b65..6140a532 100644 --- a/src/protocol_key.c +++ b/src/protocol_key.c @@ -286,6 +286,11 @@ bool ans_key_h(connection_t *c) { return true; } } else { + if(from->outkeylength != 1) { + logger(LOG_ERR, "Node %s (%s) uses wrong keylength!", from->name, from->hostname); + return true; + } + from->outcipher = NULL; }