Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/exiftool/files/, media-libs/exiftool/
Date: Mon, 03 May 2021 13:57:50
Message-Id: 1620050253.6d7a897605b349d4f2c8e87907876b42e99f8ffa.whissi@gentoo
1 commit: 6d7a897605b349d4f2c8e87907876b42e99f8ffa
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Mon May 3 13:57:33 2021 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Mon May 3 13:57:33 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6d7a8976
7
8 media-libs/exiftool: fix CVE-2021-22204
9
10 Bug: https://bugs.gentoo.org/785667
11 Package-Manager: Portage-3.0.18, Repoman-3.0.3
12 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
13
14 media-libs/exiftool/exiftool-12.16-r1.ebuild | 27 +++++++++++++++++++
15 .../files/exiftool-12.16-CVE-2021-22204.patch | 30 ++++++++++++++++++++++
16 2 files changed, 57 insertions(+)
17
18 diff --git a/media-libs/exiftool/exiftool-12.16-r1.ebuild b/media-libs/exiftool/exiftool-12.16-r1.ebuild
19 new file mode 100644
20 index 00000000000..faaa13a5828
21 --- /dev/null
22 +++ b/media-libs/exiftool/exiftool-12.16-r1.ebuild
23 @@ -0,0 +1,27 @@
24 +# Copyright 1999-2021 Gentoo Authors
25 +# Distributed under the terms of the GNU General Public License v2
26 +
27 +EAPI=7
28 +
29 +DIST_NAME=Image-ExifTool
30 +inherit perl-module
31 +
32 +DESCRIPTION="Read and write meta information in image, audio and video files"
33 +HOMEPAGE="https://exiftool.org/"
34 +SRC_URI="https://exiftool.org/${DIST_P}.tar.gz"
35 +
36 +SLOT="0"
37 +KEYWORDS="~amd64 ~arm64 ~ppc ~ppc64 ~x86 ~x64-macos"
38 +IUSE="doc"
39 +
40 +PATCHES=( "${FILESDIR}"/exiftool-12.16-CVE-2021-22204.patch )
41 +
42 +SRC_TEST="do"
43 +
44 +src_install() {
45 + perl-module_src_install
46 + use doc && dodoc -r html/
47 +
48 + insinto /usr/share/${PN}
49 + doins -r fmt_files config_files arg_files
50 +}
51
52 diff --git a/media-libs/exiftool/files/exiftool-12.16-CVE-2021-22204.patch b/media-libs/exiftool/files/exiftool-12.16-CVE-2021-22204.patch
53 new file mode 100644
54 index 00000000000..1c9e7921c6b
55 --- /dev/null
56 +++ b/media-libs/exiftool/files/exiftool-12.16-CVE-2021-22204.patch
57 @@ -0,0 +1,30 @@
58 +Description: Fix 'eval injection".
59 + CVE-2021-22204: Improper neutralization of user data in the DjVu file
60 + format in ExifTool versions 7.44 and up allows arbitrary code execution
61 + when parsing the malicious image
62 +Origin: upstream release 12.24
63 +Bug-Debian: https://bugs.debian.org/987505
64 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1925985
65 +Author: Phil Harvey <philharvey66@×××××.com>
66 +Reviewed-by: gregor herrmann <gregoa@××××××.org>
67 +Last-Update: 2021-04-24
68 +Applied-Upstream: https://github.com/exiftool/exiftool/commit/cf0f4e7dcd024ca99615bfd1102a841a25dde031#diff-fa0d652d10dbcd246e6b1df16c1e992931d3bb717a7e36157596b76bdadb3800
69 +
70 +--- a/lib/Image/ExifTool/DjVu.pm
71 ++++ b/lib/Image/ExifTool/DjVu.pm
72 +@@ -227,10 +227,11 @@
73 + last unless $tok =~ /(\\+)$/ and length($1) & 0x01;
74 + $tok .= '"'; # quote is part of the string
75 + }
76 +- # must protect unescaped "$" and "@" symbols, and "\" at end of string
77 +- $tok =~ s{\\(.)|([\$\@]|\\$)}{'\\'.($2 || $1)}sge;
78 +- # convert C escape sequences (allowed in quoted text)
79 +- $tok = eval qq{"$tok"};
80 ++ # convert C escape sequences, allowed in quoted text
81 ++ # (note: this only converts a few of them!)
82 ++ my %esc = ( a => "\a", b => "\b", f => "\f", n => "\n",
83 ++ r => "\r", t => "\t", '"' => '"', '\\' => '\\' );
84 ++ $tok =~ s/\\(.)/$esc{$1}||'\\'.$1/egs;
85 + } else { # key name
86 + pos($$dataPt) = pos($$dataPt) - 1;
87 + # allow anything in key but whitespace, braces and double quotes