From 765eeff79a37c2d1fe47f12fb758d92180109242 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Mar 31 2020 09:34:56 +0000 Subject: import okular-4.10.5-8.el7 --- diff --git a/SOURCES/okular-fix-path-traversal-issue-when-extracting-okular-file.patch b/SOURCES/okular-fix-path-traversal-issue-when-extracting-okular-file.patch new file mode 100644 index 0000000..82bafe9 --- /dev/null +++ b/SOURCES/okular-fix-path-traversal-issue-when-extracting-okular-file.patch @@ -0,0 +1,23 @@ +diff --git a/core/document.cpp b/core/document.cpp +index bc0232a..a2c8b46 100644 +--- a/core/document.cpp ++++ b/core/document.cpp +@@ -3826,6 +3826,18 @@ bool Document::openDocumentArchive( const QString & docFile, const KUrl & url ) + return false; + + const KArchiveDirectory * mainDir = okularArchive.directory(); ++ ++ // Check the archive doesn't have folders, we don't create them when saving the archive ++ // and folders mean paths and paths mean path traversal issues ++ foreach ( const QString &entry, mainDir->entries() ) ++ { ++ if ( mainDir->entry( entry )->isDirectory() ) ++ { ++ kWarning(OkularDebug) << "Warning: Found a directory inside" << docFile << " - Okular does not create files like that so it is most probably forged."; ++ return false; ++ } ++ } ++ + const KArchiveEntry * mainEntry = mainDir->entry( "content.xml" ); + if ( !mainEntry || !mainEntry->isFile() ) + return false; diff --git a/SPECS/okular.spec b/SPECS/okular.spec index 19a780a..ea04885 100644 --- a/SPECS/okular.spec +++ b/SPECS/okular.spec @@ -1,7 +1,7 @@ Name: okular Summary: A document viewer Version: 4.10.5 -Release: 7%{?dist} +Release: 8%{?dist} License: GPLv2 URL: https://projects.kde.org/projects/kde/kdegraphics/okular @@ -28,6 +28,9 @@ Patch53: okular-4.10-cmake.patch Patch54: okular-add-information-about-substituting-font.patch +# Bug 1626265 - CVE-2018-1000801 okular: Directory traversal in function unpackDocumentArchive() in core/document.cpp +Patch55: okular-fix-path-traversal-issue-when-extracting-okular-file.patch + %if 0%{?fedora} BuildRequires: chmlib-devel BuildRequires: ebook-tools-devel @@ -98,6 +101,7 @@ Summary: A kioslave for displaying WinHelp files %patch52 -p1 -b .overflow %patch53 -p1 -b .cmake %patch54 -p1 -b .add-information-about-substituting-font +%patch55 -p1 -b .fix-path-traversal-issue-when-extracting-okular-file %build mkdir -p %{_target_platform} @@ -180,6 +184,10 @@ fi %changelog +* Wed Oct 23 2019 Jan Grulich - 4.10.5-8 +- Fix path traversal issue when extracting an .okular file + Resolves: bz#1634726 + * Tue May 07 2019 Jan Grulich - 4.10.5-7 - Fix patch adding information about substituting font Resolves: bz#1458037