From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Famulari Subject: [PATCH 1/1] gnu: screen: Fix CVE-2017-5618. Date: Sat, 11 Feb 2017 22:48:38 -0500 Message-ID: <0396b13063aafe1018ae890c08409980b3e1ec8d.1486871318.git.leo@famulari.name> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33529) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ccl9f-0006wU-R1 for guix-devel@gnu.org; Sat, 11 Feb 2017 22:48:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ccl9b-0003hg-WE for guix-devel@gnu.org; Sat, 11 Feb 2017 22:48:51 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:35620) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ccl9a-0003hL-O3 for guix-devel@gnu.org; Sat, 11 Feb 2017 22:48:47 -0500 Received: from localhost.localdomain (c-73-188-17-148.hsd1.pa.comcast.net [73.188.17.148]) by mail.messagingengine.com (Postfix) with ESMTPA id 7DAE724345 for ; Sat, 11 Feb 2017 22:48:44 -0500 (EST) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org * gnu/packages/patches/screen-CVE-2017-5618.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/screen.scm (screen)[source]: Use it. --- gnu/local.mk | 1 + gnu/packages/patches/screen-CVE-2017-5618.patch | 40 +++++++++++++++++++++++++ gnu/packages/screen.scm | 2 ++ 3 files changed, 43 insertions(+) create mode 100644 gnu/packages/patches/screen-CVE-2017-5618.patch diff --git a/gnu/local.mk b/gnu/local.mk index 2a054ea64..47cbffce0 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -888,6 +888,7 @@ dist_patch_DATA = \ %D%/packages/patches/sed-hurd-path-max.patch \ %D%/packages/patches/scheme48-tests.patch \ %D%/packages/patches/scotch-test-threading.patch \ + %D%/packages/patches/screen-CVE-2017-5618.patch \ %D%/packages/patches/sdl-libx11-1.6.patch \ %D%/packages/patches/seq24-rename-mutex.patch \ %D%/packages/patches/serf-comment-style-fix.patch \ diff --git a/gnu/packages/patches/screen-CVE-2017-5618.patch b/gnu/packages/patches/screen-CVE-2017-5618.patch new file mode 100644 index 000000000..1b95e428c --- /dev/null +++ b/gnu/packages/patches/screen-CVE-2017-5618.patch @@ -0,0 +1,40 @@ +Fixes CVE-2017-5618 (privilege escalation via opening the logfile when +screen is installed setuid root): + +https://savannah.gnu.org/bugs/?50142 +https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-5618 + +This patch reverts the upstream commit that introduced the bug: + +https://git.savannah.gnu.org/cgit/screen.git/commit/?id=5460f5d28c01a9a58e021eb1dffef2965e629d58 + +From f55b0cc29a0ac2a1c54e8a5e886b7393edd4a76c Mon Sep 17 00:00:00 2001 +From: Leo Famulari +Date: Sat, 11 Feb 2017 22:40:24 -0500 +Subject: [PATCH] Revert "adding permissions check for the logfile name" + +This reverts commit 5460f5d28c01a9a58e021eb1dffef2965e629d58. +--- + src/screen.c | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/src/screen.c b/src/screen.c +index 64650e9..283c305 100644 +--- a/src/screen.c ++++ b/src/screen.c +@@ -673,12 +673,6 @@ int main(int ac, char** av) + Panic(0, "-L: logfile name can not start with \"-\" symbol"); + if (strlen(screenlogfile) > PATH_MAX) + Panic(0, "-L: logfile name too long. (max. %d char)", PATH_MAX); +- +- FILE *w_check; +- if ((w_check = fopen(screenlogfile, "w")) == NULL) +- Panic(0, "-L: logfile name access problem"); +- else +- fclose(w_check); + } + nwin_options.Lflag = 1; + break; +-- +2.11.1 + diff --git a/gnu/packages/screen.scm b/gnu/packages/screen.scm index 4f8109abb..57e6cb595 100644 --- a/gnu/packages/screen.scm +++ b/gnu/packages/screen.scm @@ -40,6 +40,8 @@ (method url-fetch) (uri (string-append "mirror://gnu/screen/screen-" version ".tar.gz")) + (patches (search-patches "screen-CVE-2017-5618.patch")) + (patch-flags '("-p2")) (sha256 (base32 "1c7grw03a9iwvqbxfd6hmjb681rp8gb55zsxm7b3apqqcb1sghq1")))) (build-system gnu-build-system) -- 2.11.1