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.
From 934e7d752bdd04521c8d0bc2c6cde4a66bf074b4 Mon Sep 17 00:00:00 2001 From: Alex Vong <alexvong1...@gmail.com> 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. --- 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 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -862,6 +862,7 @@ dist_patch_DATA = \ %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.patch \ + %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 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -162,7 +162,8 @@ implementation offers several extensions over the standard utility.") (sha256 (base32 "097hx7sbzp8qirl4m930lw84kn0wmxhmq7v1qpra3mrg0b8cyba0")) - (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/patches/tar-CVE-2016-6321.patch new file mode 100644 index 000000000..9e6ee653d --- /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=CVE-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=7340f67b9860ea0531c1450e5aa261c50f67165d + +From 7340f67b9860ea0531c1450e5aa261c50f67165d Mon Sep 17 00:00:00 2001 +From: Paul Eggert <egg...@penguin.cs.ucla.edu> +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; + + fatal_exit_hook = extract_finish; + + set_next_block_after (current_header); + ++ skip_dotdot_name = (!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))) + { +-- +2.11.0 + -- 2.11.0
Happy New Year! Cheers, Alex
--- Begin Message --------BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 - ------------------------------------------------------------------------- Debian Security Advisory DSA-3702-1 secur...@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-annou...@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-----
--- End Message ---
signature.asc
Description: PGP signature