From patchwork Thu Mar 25 06:44:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 1662 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director12.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id YJpUEHnMXGCGFwAAIUCqbw (envelope-from ) for ; Thu, 25 Mar 2021 13:46:33 -0400 Received: from proxy8.mail.ord1d.rsapps.net ([172.30.191.6]) by director12.mail.ord1d.rsapps.net with LMTP id 2O8EEHnMXGCtIAAAIasKDg (envelope-from ) for ; Thu, 25 Mar 2021 13:46:33 -0400 Received: from smtp5.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy8.mail.ord1d.rsapps.net with LMTPS id GNBTD3nMXGDxcgAAGdz6CA (envelope-from ) for ; Thu, 25 Mar 2021 13:46:33 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp5.gate.ord1d.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dmarc=none (p=nil; dis=none) header.from=rfc2549.org X-Suspicious-Flag: YES X-Classification-ID: 0811a55c-8d92-11eb-bfc9-525400d73c44-1-1 Received: from [216.105.38.7] ([216.105.38.7:57902] helo=lists.sourceforge.net) by smtp5.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id A7/18-11705-67CCC506; Thu, 25 Mar 2021 13:46:31 -0400 Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.92.3) (envelope-from ) id 1lPU3B-0001TN-Hx; Thu, 25 Mar 2021 17:45:41 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1lPU2o-0001Sl-Es for openvpn-devel@lists.sourceforge.net; Thu, 25 Mar 2021 17:45:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=zq46yGNQHBpYysVVIvLIPZsTm5fP/5tvAX1/UaOjoeU=; b=D5AmYqc71d4BJTwnN2WcRJEm6Z sa2fwLenFpq+4Sgrhu6G92zSoWk6BJh2bK/y9QwiuRI63zXW1tkWhK7GpfFg1FXanHoVkkRg/zBwW 3FCh/D/1hmZ5q9Qr6WRWAv1WASbIqdc3yXRE+MUvTwcghoytzUNB0zP7SptcM7J1LGpo=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:MIME-Version: Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=zq46yGNQHBpYysVVIvLIPZsTm5fP/5tvAX1/UaOjoeU=; b=k/9aZpT6NlhzhkUPP66YwJKbcI Ytfy5iy4oidGfPF+aoQVnUdwdmYHuuZtxgRGqrkJT55SkDDzMUzfmQfmTKTWU6hI7jYggFd2d7u1t FufHzjlVMw6btGqc+JYRey9e9lRFPlTCXxAsEnyIFKpnrqeIWMMmEh1Lp7+Tywo7T26M=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1lPU2S-00AcUB-Sd for openvpn-devel@lists.sourceforge.net; Thu, 25 Mar 2021 17:45:18 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.94 (FreeBSD)) (envelope-from ) id 1lPU2L-000IIu-Il for openvpn-devel@lists.sourceforge.net; Thu, 25 Mar 2021 18:44:49 +0100 Received: (nullmailer pid 26992 invoked by uid 10006); Thu, 25 Mar 2021 17:44:49 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Thu, 25 Mar 2021 18:44:49 +0100 Message-Id: <20210325174449.26948-1-arne@rfc2549.org> X-Mailer: git-send-email 2.17.1 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: rfc2549.org] 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-Headers-End: 1lPU2S-00AcUB-Sd Subject: [Openvpn-devel] [PATCH] Always disable SSL renegotiations X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox These have been troublesome in the past and also today's CVE-2021-3449 DOS is only exploitable if renegotiation is enabled. Signed-off-by: Arne Schwabe --- src/openvpn/ssl_mbedtls.c | 3 +++ src/openvpn/ssl_openssl.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/openvpn/ssl_mbedtls.c b/src/openvpn/ssl_mbedtls.c index 4626e9838..1628a02e3 100644 --- a/src/openvpn/ssl_mbedtls.c +++ b/src/openvpn/ssl_mbedtls.c @@ -1086,6 +1086,9 @@ key_state_ssl_init(struct key_state_ssl *ks_ssl, { mbedtls_ssl_conf_curves(ks_ssl->ssl_config, ssl_ctx->groups); } + /* Disable renegotiations. OpenVPN has its own mechanism to create whole + * new SSL session. And these have been problematic in the past */ + mbedtls_ssl_conf_renegotiation(ks_ssl->ssl_config, MBEDTLS_SSL_RENEGOTIATION_DISABLED); /* Disable record splitting (for now). OpenVPN assumes records are sent * unfragmented, and changing that will require thorough review and diff --git a/src/openvpn/ssl_openssl.c b/src/openvpn/ssl_openssl.c index d161f48b8..a11ca5b97 100644 --- a/src/openvpn/ssl_openssl.c +++ b/src/openvpn/ssl_openssl.c @@ -320,6 +320,9 @@ tls_ctx_set_options(struct tls_root_ctx *ctx, unsigned int ssl_flags) sslopt |= SSL_OP_CIPHER_SERVER_PREFERENCE; #endif sslopt |= SSL_OP_NO_COMPRESSION; + /* Disable renegotiations. OpenVPN has its own mechanism to create whole + * new SSL session. And these have been probelmatic in the past */ + sslopt |= SSL_OP_NO_RENEGOTIATION; SSL_CTX_set_options(ctx->ctx, sslopt);