From 676a83f6f942fc0effc9a3e3b4aeceafe9527e48 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Aug 01 2017 14:36:18 +0000 Subject: import evince-3.22.1-5.2.el7_4 --- diff --git a/SOURCES/0001-comics-Remove-support-for-tar-and-tar-like-commands.patch b/SOURCES/0001-comics-Remove-support-for-tar-and-tar-like-commands.patch new file mode 100644 index 0000000..a547ba1 --- /dev/null +++ b/SOURCES/0001-comics-Remove-support-for-tar-and-tar-like-commands.patch @@ -0,0 +1,131 @@ +From 717df38fd8509bf883b70d680c9b1b3cf36732ee Mon Sep 17 00:00:00 2001 +From: Bastien Nocera +Date: Thu, 6 Jul 2017 20:02:00 +0200 +Subject: [PATCH] comics: Remove support for tar and tar-like commands + +When handling tar files, or using a command with tar-compatible syntax, +to open comic-book archives, both the archive name (the name of the +comics file) and the filename (the name of a page within the archive) +are quoted to not be interpreted by the shell. + +But the filename is completely with the attacker's control and can start +with "--" which leads to tar interpreting it as a command line flag. + +This can be exploited by creating a CBT file (a tar archive with the +.cbt suffix) with an embedded file named something like this: +"--checkpoint-action=exec=bash -c 'touch ~/hacked;'.jpg" + +CBT files are infinitely rare (CBZ is usually used for DRM-free +commercial releases, CBR for those from more dubious provenance), so +removing support is the easiest way to avoid the bug triggering. All +this code was rewritten in the development release for GNOME 3.26 to not +shell out to any command, closing off this particular attack vector. + +This also removes the ability to use libarchive's bsdtar-compatible +binary for CBZ (ZIP), CB7 (7zip), and CBR (RAR) formats. The first two +are already supported by unzip and 7zip respectively. libarchive's RAR +support is limited, so unrar is a requirement anyway. + +Discovered by Felix Wilhelm from the Google Security Team. + +https://bugzilla.gnome.org/show_bug.cgi?id=784630 +--- + backend/comics/comics-document.c | 40 +--------------------------------------- + configure.ac | 2 +- + 2 files changed, 2 insertions(+), 40 deletions(-) + +diff --git a/backend/comics/comics-document.c b/backend/comics/comics-document.c +index 4c747310..641d7856 100644 +--- a/backend/comics/comics-document.c ++++ b/backend/comics/comics-document.c +@@ -56,8 +56,7 @@ typedef enum + RARLABS, + GNAUNRAR, + UNZIP, +- P7ZIP, +- TAR ++ P7ZIP + } ComicBookDecompressType; + + typedef struct _ComicsDocumentClass ComicsDocumentClass; +@@ -117,9 +116,6 @@ static const ComicBookDecompressCommand command_usage_def[] = { + + /* 7zip */ + {NULL , "%s l -- %s" , "%s x -y %s -o%s", FALSE, OFFSET_7Z}, +- +- /* tar */ +- {"%s -xOf" , "%s -tf %s" , NULL , FALSE, NO_OFFSET} + }; + + static GSList* get_supported_image_extensions (void); +@@ -364,13 +360,6 @@ comics_check_decompress_command (gchar *mime_type, + comics_document->command_usage = GNAUNRAR; + return TRUE; + } +- comics_document->selected_command = +- g_find_program_in_path ("bsdtar"); +- if (comics_document->selected_command) { +- comics_document->command_usage = TAR; +- return TRUE; +- } +- + } else if (g_content_type_is_a (mime_type, "application/x-cbz") || + g_content_type_is_a (mime_type, "application/zip")) { + /* InfoZIP's unzip program */ +@@ -396,12 +385,6 @@ comics_check_decompress_command (gchar *mime_type, + comics_document->command_usage = P7ZIP; + return TRUE; + } +- comics_document->selected_command = +- g_find_program_in_path ("bsdtar"); +- if (comics_document->selected_command) { +- comics_document->command_usage = TAR; +- return TRUE; +- } + + } else if (g_content_type_is_a (mime_type, "application/x-cb7") || + g_content_type_is_a (mime_type, "application/x-7z-compressed")) { +@@ -425,27 +408,6 @@ comics_check_decompress_command (gchar *mime_type, + comics_document->command_usage = P7ZIP; + return TRUE; + } +- comics_document->selected_command = +- g_find_program_in_path ("bsdtar"); +- if (comics_document->selected_command) { +- comics_document->command_usage = TAR; +- return TRUE; +- } +- } else if (g_content_type_is_a (mime_type, "application/x-cbt") || +- g_content_type_is_a (mime_type, "application/x-tar")) { +- /* tar utility (Tape ARchive) */ +- comics_document->selected_command = +- g_find_program_in_path ("tar"); +- if (comics_document->selected_command) { +- comics_document->command_usage = TAR; +- return TRUE; +- } +- comics_document->selected_command = +- g_find_program_in_path ("bsdtar"); +- if (comics_document->selected_command) { +- comics_document->command_usage = TAR; +- return TRUE; +- } + } else { + g_set_error (error, + EV_DOCUMENT_ERROR, +diff --git a/configure.ac b/configure.ac +index 9e9f8316..7eb0f1f3 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -795,7 +795,7 @@ AC_SUBST(TIFF_MIME_TYPES) + AC_SUBST(APPDATA_TIFF_MIME_TYPES) + AM_SUBST_NOTMAKE(APPDATA_TIFF_MIME_TYPES) + if test "x$enable_comics" = "xyes"; then +- COMICS_MIME_TYPES="application/x-cbr;application/x-cbz;application/x-cb7;application/x-cbt;application/x-ext-cbr;application/x-ext-cbz;application/vnd.comicbook+zip;application/x-ext-cb7;application/x-ext-cbt" ++ COMICS_MIME_TYPES="application/x-cbr;application/x-cbz;application/x-cb7;application/x-ext-cbr;application/x-ext-cbz;application/vnd.comicbook+zip;application/x-ext-cb7" + APPDATA_COMICS_MIME_TYPES=$(echo "$COMICS_MIME_TYPES" | sed -e 's/;/<\/mimetype>\n /g') + if test -z "$EVINCE_MIME_TYPES"; then + EVINCE_MIME_TYPES="${COMICS_MIME_TYPES}" +-- +2.13.0 + diff --git a/SPECS/evince.spec b/SPECS/evince.spec index 4785a0b..307d0da 100644 --- a/SPECS/evince.spec +++ b/SPECS/evince.spec @@ -5,7 +5,7 @@ Name: evince Version: 3.22.1 -Release: 5%{?dist} +Release: 5.2%{?dist} Summary: Document viewer License: GPLv2+ and GPLv3+ and LGPLv2+ and MIT and Afmparse @@ -21,6 +21,9 @@ Patch2: 0001-Resolves-rhbz-1404656-crash-on-opening-second-evince.patch Patch3: 0001-Resolves-deb-762530-rhbz-1061177-add-man-pages.patch Patch4: 0001-Resolves-rhbz-1358249-page-up-down.patch Patch5: 0001-Revert-Bump-poppler-requirements-to-0.33.0.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1468488 +# https://bugzilla.redhat.com/show_bug.cgi?id=1469528 +Patch6: 0001-comics-Remove-support-for-tar-and-tar-like-commands.patch BuildRequires: pkgconfig(adwaita-icon-theme) BuildRequires: pkgconfig(gio-unix-2.0) >= %{glib2_version} @@ -130,7 +133,7 @@ This package contains the evince web browser plugin. %patch3 -p1 -b .deb-762530-rhbz %patch4 -p1 -b .rhbz-1358249-page-up-down %patch5 -p1 -b .poppler-requirements - +%patch6 -p1 -b .no-tar %build autoreconf -f -i @@ -274,6 +277,14 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas >&/dev/null ||: %{_libdir}/mozilla/plugins/libevbrowserplugin.so %changelog +* Mon Jul 17 2017 Caolán McNamara - 3.22.1-5.2 +- Related: #1469528 ensure .desktop file is still valid + +* Fri Jul 07 2017 Bastien Nocera - 3.22.1-5.1 ++ Fix arbitrary code execution via filename in tar-compressed + comics archive +- Resolves: #1469528 + * Mon Jan 16 2017 Caolán McNamara - 3.22.1-5 - Resolves: rhbz#1358249 restore ctrl page up/down shortcuts