diff options
author | Max Rees <maxcrees@me.com> | 2019-08-04 00:42:54 -0500 |
---|---|---|
committer | Max Rees <maxcrees@me.com> | 2019-08-04 00:42:54 -0500 |
commit | 1ca5d4bd50ec27c389e11663177675325cbb13c8 (patch) | |
tree | 1b3fdc6a833c528ac7d4c83ab249b07992a92be0 /user | |
parent | 958249701a8a0627aaff853b646803caebc9f219 (diff) | |
download | packages-1ca5d4bd50ec27c389e11663177675325cbb13c8.tar.gz packages-1ca5d4bd50ec27c389e11663177675325cbb13c8.tar.bz2 packages-1ca5d4bd50ec27c389e11663177675325cbb13c8.tar.xz packages-1ca5d4bd50ec27c389e11663177675325cbb13c8.zip |
user/libvncserver: patch for CVE-2018-15127 (#134)
Diffstat (limited to 'user')
-rw-r--r-- | user/libvncserver/APKBUILD | 8 | ||||
-rw-r--r-- | user/libvncserver/CVE-2018-15127.patch | 44 |
2 files changed, 50 insertions, 2 deletions
diff --git a/user/libvncserver/APKBUILD b/user/libvncserver/APKBUILD index 0801da573..764fec75a 100644 --- a/user/libvncserver/APKBUILD +++ b/user/libvncserver/APKBUILD @@ -14,13 +14,16 @@ depends_dev="libgcrypt-dev libjpeg-turbo-dev gnutls-dev libpng-dev libxi-dev libxinerama-dev libxrandr-dev libxtst-dev" makedepends="$depends_dev autoconf automake libtool" subpackages="$pkgname-dev" -source="https://github.com/LibVNC/libvncserver/archive/LibVNCServer-$pkgver.tar.gz" +source="https://github.com/LibVNC/libvncserver/archive/LibVNCServer-$pkgver.tar.gz + CVE-2018-15127.patch" builddir="$srcdir"/libvncserver-LibVNCServer-$pkgver # secfixes: # 0.9.11-r0: # - CVE-2016-9941 # - CVE-2016-9942 +# 0.9.12-r0: +# - CVE-2018-15127 build() { if [ "$CBUILD" != "$CHOST" ]; then @@ -45,4 +48,5 @@ package() { make install DESTDIR="$pkgdir" } -sha512sums="60ff1cc93a937d6f8f97449bc58b763095846207112f7b1b3c43eb2d74448b595d6da949903a764bd484ee54e38ff6277e882adbe965dd6d26ba15ef6ff6fcb8 LibVNCServer-0.9.12.tar.gz" +sha512sums="60ff1cc93a937d6f8f97449bc58b763095846207112f7b1b3c43eb2d74448b595d6da949903a764bd484ee54e38ff6277e882adbe965dd6d26ba15ef6ff6fcb8 LibVNCServer-0.9.12.tar.gz +8b5b6742e6c3a181c60652484b15ec42cc0a3acc1e82cef38e82b61f43f1de456d09731976f4e5dfab44abf3e551e22aaf4300cb8418cd8e136d705fcb2a7dbe CVE-2018-15127.patch" diff --git a/user/libvncserver/CVE-2018-15127.patch b/user/libvncserver/CVE-2018-15127.patch new file mode 100644 index 000000000..146243670 --- /dev/null +++ b/user/libvncserver/CVE-2018-15127.patch @@ -0,0 +1,44 @@ +From 09e8fc02f59f16e2583b34fe1a270c238bd9ffec Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> +Date: Mon, 7 Jan 2019 10:40:01 +0100 +Subject: [PATCH] Limit lenght to INT_MAX bytes in + rfbProcessFileTransferReadBuffer() + +This ammends 15bb719c03cc70f14c36a843dcb16ed69b405707 fix for a heap +out-of-bound write access in rfbProcessFileTransferReadBuffer() when +reading a transfered file content in a server. The former fix did not +work on platforms with a 32-bit int type (expected by rfbReadExact()). + +CVE-2018-15127 +<https://github.com/LibVNC/libvncserver/issues/243> +<https://github.com/LibVNC/libvncserver/issues/273> +--- + libvncserver/rfbserver.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/libvncserver/rfbserver.c b/libvncserver/rfbserver.c +index 7af84906..f2edbeea 100644 +--- a/libvncserver/rfbserver.c ++++ b/libvncserver/rfbserver.c +@@ -88,6 +88,8 @@ + #include <errno.h> + /* strftime() */ + #include <time.h> ++/* INT_MAX */ ++#include <limits.h> + + #ifdef LIBVNCSERVER_WITH_WEBSOCKETS + #include "rfbssl.h" +@@ -1472,8 +1474,11 @@ char *rfbProcessFileTransferReadBuffer(rfbClientPtr cl, uint32_t length) + 0XFFFFFFFF, i.e. SIZE_MAX for 32-bit systems. On 64-bit systems, a length of 0XFFFFFFFF + will safely be allocated since this check will never trigger and malloc() can digest length+1 + without problems as length is a uint32_t. ++ We also later pass length to rfbReadExact() that expects a signed int type and ++ that might wrap on platforms with a 32-bit int type if length is bigger ++ than 0X7FFFFFFF. + */ +- if(length == SIZE_MAX) { ++ if(length == SIZE_MAX || length > INT_MAX) { + rfbErr("rfbProcessFileTransferReadBuffer: too big file transfer length requested: %u", (unsigned int)length); + rfbCloseClient(cl); + return NULL; |