File: 0001-Drop-too-short-control-channel-packets-instead-of-as.patch

package info (click to toggle)
openvpn 2.2.1-8%2Bdeb7u3
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 8,960 kB
  • sloc: ansic: 60,297; sh: 5,704; python: 631; makefile: 282; perl: 242; awk: 13
file content (42 lines) | stat: -rw-r--r-- 1,576 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From c5590a6821e37f3b29735f55eb0c2b9c0924138c Mon Sep 17 00:00:00 2001
From: Steffan Karger <steffan.karger@fox-it.com>
Date: Thu, 20 Nov 2014 13:43:05 +0100
Subject: [PATCH] Drop too-short control channel packets instead of asserting
 out.

This fixes a denial-of-service vulnerability where an authenticated client
could stop the server by triggering a server-side ASSERT().

OpenVPN would previously ASSERT() that control channel packets have a
payload of at least 4 bytes. An authenticated client could trigger this
assert by sending a too-short control channel packet to the server.

Thanks to Dragana Damjanovic for reporting the issue.

This bug has been assigned CVE-2014-8104.

Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1CED409804E2164C8104F9E623B08B9018803B0FE7@FOXDFT02.FOX.local>
Signed-off-by: Gert Doering <gert@greenie.muc.de>
---
 ssl.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Index: openvpn-2.2.1/ssl.c
===================================================================
--- openvpn-2.2.1.orig/ssl.c	2011-06-24 08:13:39.000000000 +0200
+++ openvpn-2.2.1/ssl.c	2014-12-01 16:28:25.003615544 +0100
@@ -3751,7 +3751,11 @@
   ALLOC_ARRAY_CLEAR_GC (options, char, TLS_OPTIONS_LEN, &gc);
 		  
   /* discard leading uint32 */
-  ASSERT (buf_advance (buf, 4));
+  if (!buf_advance (buf, 4)) {
+    msg (D_TLS_ERRORS, "TLS ERROR: Plaintext buffer too short (%d bytes).",
+	buf->len);
+    goto error;
+  }
 
   /* get key method */
   key_method_flags = buf_read_u8 (buf);