aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias C. Berner <tcberner@FreeBSD.org>2016-08-30 18:10:34 +0000
committerTobias C. Berner <tcberner@FreeBSD.org>2016-08-30 18:10:34 +0000
commitab5ae0addbad15577a42f27263c6cf9d8f386362 (patch)
tree6b05ecb691d1d084c5dca6f45399e367d8d8369e
parent9c1cc584947f5078cfb37a3e07f2431a5b67467f (diff)
downloadports-ab5ae0addbad15577a42f27263c6cf9d8f386362.tar.gz
ports-ab5ae0addbad15577a42f27263c6cf9d8f386362.zip
MFH: r420994
Add upstream patch for a security issue in karchive: Directory traversal vulnerability in KArchive before 5.24, as used in KDE Frameworks, allows remote attackers to write to arbitrary files via a ../ (dot dot slash) in a filename in an archive file, related to KNewsstuff downloads. Review the patch is from: https://git.reviewboard.kde.org/r/128749/ Original KF5 review: https://git.reviewboard.kde.org/r/128185/ CVE: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-6232 Approved by: rakuco (mentor) Security: 4472ab39-6c66-11e6-9ca5-50e549ebab6c, CVE-2016-6232 Approved by: ports-secteam (junovitch), rakuco (mentor)
Notes
Notes: svn path=/branches/2016Q3/; revision=421128
-rw-r--r--x11/kdelibs4/Makefile2
-rw-r--r--x11/kdelibs4/files/patch-git_dd1c2da44
2 files changed, 45 insertions, 1 deletions
diff --git a/x11/kdelibs4/Makefile b/x11/kdelibs4/Makefile
index 96f2c3b3be3d..ef9b2354d054 100644
--- a/x11/kdelibs4/Makefile
+++ b/x11/kdelibs4/Makefile
@@ -3,7 +3,7 @@
PORTNAME= kdelibs
PORTVERSION= ${KDE4_KDELIBS_VERSION}
-PORTREVISION= 6
+PORTREVISION= 7
CATEGORIES= x11 kde
MASTER_SITES= KDE/${KDE4_APPLICATIONS_BRANCH}/applications/${KDE4_APPLICATIONS_VERSION}/src
DIST_SUBDIR= KDE/${PORTVERSION}
diff --git a/x11/kdelibs4/files/patch-git_dd1c2da b/x11/kdelibs4/files/patch-git_dd1c2da
new file mode 100644
index 000000000000..f70609e81c86
--- /dev/null
+++ b/x11/kdelibs4/files/patch-git_dd1c2da
@@ -0,0 +1,44 @@
+From dd1c2da9d26fd4cfc7fe0a25f413e536d56cf2db Mon Sep 17 00:00:00 2001
+From: Albert Astals Cid <aacid@kde.org>
+Date: Fri, 26 Aug 2016 00:30:34 +0200
+Subject: [PATCH] Backport karchive fix for out of directory files
+
+REVIEW: 128749
+---
+ kdecore/io/karchive.cpp | 15 +++++++++++++--
+
+diff --git kdecore/io/karchive.cpp kdecore/io/karchive.cpp
+index eb0bf2e..d3f8c67 100644
+--- kdecore/io/karchive.cpp
++++ kdecore/io/karchive.cpp
+@@ -800,6 +800,7 @@ static bool sortByPosition( const KArchiveFile* file1, const KArchiveFile* file2
+ void KArchiveDirectory::copyTo(const QString& dest, bool recursiveCopy ) const
+ {
+ QDir root;
++ const QString destDir(QDir(dest).absolutePath()); // get directory path without any "." or ".."
+
+ QList<const KArchiveFile*> fileList;
+ QMap<qint64, QString> fileToDir;
+@@ -809,10 +810,20 @@ void KArchiveDirectory::copyTo(const QString& dest, bool recursiveCopy ) const
+ QStack<QString> dirNameStack;
+
+ dirStack.push( this ); // init stack at current directory
+- dirNameStack.push( dest ); // ... with given path
++ dirNameStack.push( destDir ); // ... with given path
+ do {
+ const KArchiveDirectory* curDir = dirStack.pop();
+- const QString curDirName = dirNameStack.pop();
++
++ // extract only to specified folder if it is located within archive's extraction folder
++ // otherwise put file under root position in extraction folder
++ QString curDirName = dirNameStack.pop();
++ if (!QDir(curDirName).absolutePath().startsWith(destDir)) {
++ qWarning() << "Attempted export into folder" << curDirName
++ << "which is outside of the extraction root folder" << destDir << "."
++ << "Changing export of contained files to extraction root folder.";
++ curDirName = destDir;
++ }
++
+ root.mkdir(curDirName);
+
+ const QStringList dirEntries = curDir->entries();