From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Vong Subject: [PATCH] gnu: tar: Fix CVE-2016-6321. Date: Sat, 31 Dec 2016 16:03:25 +0800 Message-ID: <87h95kplte.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34286) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cNEdq-0007Pf-RW for guix-devel@gnu.org; Sat, 31 Dec 2016 03:03:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cNEdn-00024c-6c for guix-devel@gnu.org; Sat, 31 Dec 2016 03:03:50 -0500 Received: from mail-pg0-x22d.google.com ([2607:f8b0:400e:c05::22d]:34215) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cNEdm-00023e-SH for guix-devel@gnu.org; Sat, 31 Dec 2016 03:03:47 -0500 Received: by mail-pg0-x22d.google.com with SMTP id y62so133176149pgy.1 for ; Sat, 31 Dec 2016 00:03:46 -0800 (PST) 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 --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Hi Guix, This patch fixes CVE-2016-6321 for GNU Tar. The patch is basically directly copied from upstream with the modification to the NEWS file removed since it hunks out to a reject file. The message below is for your reference. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-gnu-tar-Fix-CVE-2016-6321.patch Content-Transfer-Encoding: quoted-printable From=20934e7d752bdd04521c8d0bc2c6cde4a66bf074b4 Mon Sep 17 00:00:00 2001 From: Alex Vong Date: Sat, 31 Dec 2016 00:05:49 +0800 Subject: [PATCH] gnu: tar: Fix CVE-2016-6321. * gnu/packages/patches/tar-CVE-2016-6321.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/base.scm (tar)[source]: Add it. =2D-- gnu/local.mk | 1 + gnu/packages/base.scm | 3 +- gnu/packages/patches/tar-CVE-2016-6321.patch | 51 ++++++++++++++++++++++++= ++++ 3 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/tar-CVE-2016-6321.patch diff --git a/gnu/local.mk b/gnu/local.mk index b7c182fbf..5a7cedbe2 100644 =2D-- a/gnu/local.mk +++ b/gnu/local.mk @@ -862,6 +862,7 @@ dist_patch_DATA =3D \ %D%/packages/patches/t1lib-CVE-2010-2642.patch \ %D%/packages/patches/t1lib-CVE-2011-0764.patch \ %D%/packages/patches/t1lib-CVE-2011-1552+CVE-2011-1553+CVE-2011-1554.pat= ch \ + %D%/packages/patches/tar-CVE-2016-6321.patch \ %D%/packages/patches/tar-skip-unreliable-tests.patch \ %D%/packages/patches/tcl-mkindex-deterministic.patch \ %D%/packages/patches/tclxml-3.2-install.patch \ diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index 50c306009..ce6e3782c 100644 =2D-- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -162,7 +162,8 @@ implementation offers several extensions over the stand= ard utility.") (sha256 (base32 "097hx7sbzp8qirl4m930lw84kn0wmxhmq7v1qpra3mrg0b8cyba0")) =2D (patches (search-patches "tar-skip-unreliable-tests.patch"))= )) + (patches (search-patches "tar-CVE-2016-6321.patch" + "tar-skip-unreliable-tests.patch")))) (build-system gnu-build-system) ;; Note: test suite requires ~1GiB of disk space. (arguments diff --git a/gnu/packages/patches/tar-CVE-2016-6321.patch b/gnu/packages/pa= tches/tar-CVE-2016-6321.patch new file mode 100644 index 000000000..9e6ee653d =2D-- /dev/null +++ b/gnu/packages/patches/tar-CVE-2016-6321.patch @@ -0,0 +1,51 @@ +Fix CVE-2016-6321: + +https://cve.mitre.org/cgi-bin/cvename.cgi?name=3DCVE-2016-6321 +https://security-tracker.debian.org/tracker/CVE-2016-6321 + +Patches copied from upstream source repository +(with modification to NEWS removed since it hunks out to a reject file): + +http://git.savannah.gnu.org/cgit/tar.git/commit/?id=3D7340f67b9860ea0531c1= 450e5aa261c50f67165d + +From 7340f67b9860ea0531c1450e5aa261c50f67165d Mon Sep 17 00:00:00 2001 +From: Paul Eggert +Date: Sat, 29 Oct 2016 21:04:40 -0700 +Subject: [PATCH] When extracting, skip ".." members + +* NEWS: Document this. +* src/extract.c (extract_archive): Skip members whose names +contain "..". +--- + NEWS | 8 +++++++- + src/extract.c | 8 ++++++++ + 2 files changed, 15 insertions(+), 1 deletion(-) + +diff --git a/src/extract.c b/src/extract.c +index f982433..7904148 100644 +--- a/src/extract.c ++++ b/src/extract.c +@@ -1629,12 +1629,20 @@ extract_archive (void) + { + char typeflag; + tar_extractor_t fun; ++ bool skip_dotdot_name; +=20 + fatal_exit_hook =3D extract_finish; +=20 + set_next_block_after (current_header); +=20 ++ skip_dotdot_name =3D (!absolute_names_option ++ && contains_dot_dot (current_stat_info.orig_file_name)); ++ if (skip_dotdot_name) ++ ERROR ((0, 0, _("%s: Member name contains '..'"), ++ quotearg_colon (current_stat_info.orig_file_name))); ++ + if (!current_stat_info.file_name[0] ++ || skip_dotdot_name + || (interactive_option + && !confirm ("extract", current_stat_info.file_name))) + { +--=20 +2.11.0 + =2D-=20 2.11.0 --=-=-= Content-Type: text/plain Happy New Year! Cheers, Alex --=-=-= Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 8bit Delivered-To: alexvong1995@gmail.com Received: by 10.25.215.101 with SMTP id o98csp765827lfg; Tue, 1 Nov 2016 12:16:49 -0700 (PDT) X-Received: by 10.28.141.143 with SMTP id p137mr137643wmd.5.1478027809813; Tue, 01 Nov 2016 12:16:49 -0700 (PDT) Return-Path: Received: from bendel.debian.org (bendel.debian.org. [2001:41b8:202:deb:216:36ff:fe40:4002]) by mx.google.com with ESMTPS id b13si32809822wmi.34.2016.11.01.12.16.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Nov 2016 12:16:49 -0700 (PDT) Received-SPF: pass (google.com: manual fallback record for domain of bounce-debian-security-announce=alexvong1995=gmail.com@lists.debian.org designates 2001:41b8:202:deb:216:36ff:fe40:4002 as permitted sender) client-ip=2001:41b8:202:deb:216:36ff:fe40:4002; Authentication-Results: mx.google.com; spf=pass (google.com: manual fallback record for domain of bounce-debian-security-announce=alexvong1995=gmail.com@lists.debian.org designates 2001:41b8:202:deb:216:36ff:fe40:4002 as permitted sender) smtp.mailfrom=bounce-debian-security-announce=alexvong1995=gmail.com@lists.debian.org Received: from localhost (localhost [127.0.0.1]) by bendel.debian.org (Postfix) with QMQP id 6E5B0452; Tue, 1 Nov 2016 19:16:04 +0000 (UTC) X-Mailbox-Line: From debian-security-announce-request@lists.debian.org Tue Nov 1 19:16:04 2016 Old-Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on bendel.debian.org X-Spam-Level: X-Spam-Status: No, score=-11.7 required=4.0 tests=DIGITS_LETTERS,FOURLA, FVGT_m_MULTI_ODD,LDO_WHITELIST,OUR_MTA_MSGID,PGPSIGNATURE,RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD autolearn=unavailable autolearn_force=no version=3.4.0 X-Original-To: lists-debian-security-announce@bendel.debian.org Delivered-To: lists-debian-security-announce@bendel.debian.org Received: from localhost (localhost [127.0.0.1]) by bendel.debian.org (Postfix) with ESMTP id 9AE2B279 for ; Tue, 1 Nov 2016 19:15:54 +0000 (UTC) X-Virus-Scanned: at lists.debian.org with policy bank moderated X-Amavis-Spam-Status: No, score=-11.491 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, DIGITS_LETTERS=1, FOURLA=0.1, FVGT_m_MULTI_ODD=0.02, LDO_WHITELIST=-5, OUR_MTA_MSGID=2, PGPSIGNATURE=-5, RCVD_IN_DNSWL_MED=-2.3, RP_MATCHES_RCVD=-0.311] autolearn=ham autolearn_force=no Received: from bendel.debian.org ([127.0.0.1]) by localhost (lists.debian.org [127.0.0.1]) (amavisd-new, port 2525) with ESMTP id oVRVde_dNF3L for ; Tue, 1 Nov 2016 19:15:49 +0000 (UTC) Received: from master.debian.org (master.debian.org [IPv6:2001:41b8:202:deb:216:36ff:fe40:4001]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "master.debian.org", Issuer "Debian SMTP CA" (not verified)) by bendel.debian.org (Postfix) with ESMTPS id B9A11D6 for ; Tue, 1 Nov 2016 19:15:49 +0000 (UTC) Received: from carnil by master.debian.org with local (Exim 4.84_2) (envelope-from ) id 1c1eXD-00069r-Co for debian-security-announce@lists.debian.org; Tue, 01 Nov 2016 19:15:47 +0000 From: Salvatore Bonaccorso To: debian-security-announce@lists.debian.org Subject: [SECURITY] [DSA 3702-1] tar security update Message-Id: Date: Tue, 01 Nov 2016 19:15:47 +0000 X-Debian: PGP check passed for security officers Priority: urgent Reply-To: debian-security-announce-request@lists.debian.org X-Rc-Virus: 2007-09-13_01 X-Rc-Spam: 2008-11-04_01 Resent-Message-ID: Resent-From: debian-security-announce@lists.debian.org X-Mailing-List: archive/latest/2539 X-Loop: debian-security-announce@lists.debian.org List-Id: List-URL: List-Post: List-Help: List-Subscribe: List-Unsubscribe: Precedence: list Resent-Sender: debian-security-announce-request@lists.debian.org List-Archive: https://lists.debian.org/msgid-search/E1c1eXD-00069r-Co@master.debian.org Resent-Date: Tue, 1 Nov 2016 19:16:04 +0000 (UTC) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 - ------------------------------------------------------------------------- Debian Security Advisory DSA-3702-1 security@debian.org https://www.debian.org/security/ Salvatore Bonaccorso November 01, 2016 https://www.debian.org/security/faq - ------------------------------------------------------------------------- Package : tar CVE ID : CVE-2016-6321 Debian Bug : 842339 Harry Sintonen discovered that GNU tar does not properly handle member names containing '..', thus allowing an attacker to bypass the path names specified on the command line and replace files and directories in the target directory. For the stable distribution (jessie), this problem has been fixed in version 1.27.1-2+deb8u1. For the unstable distribution (sid), this problem has been fixed in version 1.29b-1.1. We recommend that you upgrade your tar packages. Further information about Debian Security Advisories, how to apply these updates to your system and frequently asked questions can be found at: https://www.debian.org/security/ Mailing list: debian-security-announce@lists.debian.org -----BEGIN PGP SIGNATURE----- iQJ8BAEBCgBmBQJYGOmnXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ0NjQ0NDA5ODA4QzE3MUUwNTUzMURERUUw NTRDQjhGMzEzNDNDRjQ0AAoJEAVMuPMTQ89ETe4P+wQ40R0+scWjRMusH3nqztuF gO8efN5Q+NQwQVEHv9XNxh4WOTuFrBTKicVPud4jziNx810kfe6pxXoeEdL4FvBp jb3mrETbzMMZfj2IC9OOc04bV473hw/GpTfA1BNPdnAB0eOTsYlpT2tGN/8l2bA9 MtAkVWGEq/jUITbB0hgKwwX5YOo3qq59NneQzkQM3gwfbDqOzFL0v78oRoQYKB4V /kXH5TZdNXu1kBBzQyl6C7tPYplakRSdpFbH8B+03c5dIUZj+2rjBeLqUt3BwkLQ Ym0sdWai6Hg2WPrASQ9FA7kn675RURN963cNyJ9zWZssQ+v2fxOpp+9gmYhIBSyI XUkE/FkvmygCFJkruQL1L9s3nbsIrRqqJehchFNZpse2ctyuQySANXnk/j4B3Pjz X+DmCdXS9PbxdRsr9G4JY86gcq3ZHPEylYKqmjbLIzwh2UdLvmTt72IMCPxhPkyL 9QqQ2+ROy2BeeZsqc3fS9hwIrqsn/aakB60ODTAwD47JwxKkbcaoPsLQMays/yF0 YwcobceqQh10AufdBMU22OeKZYbR0bh5dScBd6crkcPxe2/5AQnw3rF8ti2jbgJH 99Ob5Ha8vVt6ZIxdsurVzVapPhAuXgVFnbv+tT6Fo23FwV4lDqZsCt+87FKDeapO irBr67NKsaw6ZgW2b6s8 =EAIZ -----END PGP SIGNATURE----- --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEqfDnz3vyW/9qCtmBbrDlEZNRhYAFAlhnZk0ACgkQbrDlEZNR hYA33Qf/XcjXDX08pNX1QNfbhtj3xz3eZbj7j1GQ631/ZzazUP51KA3nKppNv2ZX VOvgmiIY6R0kciDgoxqLVsxHdtPyrSHH0tKPfORpJqgm6zSucRQAgk79EPKB8k/Z l3xEXid830OYTuQBE0CphI7ozbMdW57h2xAhbqyiR4LUg9q9uGrnz5rne5o015ed UF9FzLb7mCofYJVKe/iZGmUOw91d8A2AXDL1z++jTXSsl4PKGDpirWp1iDoxsw/s aKGC7In34+mLyAQtByxcDRWpqksTYBdkrnMnlGbVQUbiyetHeHH0pYKxhuRUGXVT 5Q9pYZx6mtcXONm62r6/w0fXQJA8bw== =5a1s -----END PGP SIGNATURE----- --==-=-=--