Blame mono-5.18.0-sharpziplib-parent-path-traversal.patch
|
Timotheus Pokorra |
9aa43bb |
--- a/mcs/class/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib/Zip/FastZip.cs 2019-02-21 05:54:25.493666036 +0000
|
|
Timotheus Pokorra |
9aa43bb |
+++ b/mcs/class/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib/Zip/FastZip.cs 2019-02-21 05:55:01.494273426 +0000
|
|
Timotheus Pokorra |
9aa43bb |
@@ -375,7 +375,8 @@
|
|
Timotheus Pokorra |
9aa43bb |
|
|
Timotheus Pokorra |
9aa43bb |
targetName = Path.Combine(targetDirectory, entryFileName);
|
|
Timotheus Pokorra |
9aa43bb |
dirName = Path.GetDirectoryName(Path.GetFullPath(targetName));
|
|
Timotheus Pokorra |
9aa43bb |
-
|
|
Timotheus Pokorra |
9aa43bb |
+ if (!Path.GetFullPath(targetName).StartsWith(targetDirectory, StringComparison.InvariantCultureIgnoreCase))
|
|
Timotheus Pokorra |
9aa43bb |
+ throw new ZipException("Parent traversal in paths is not allowed");
|
|
Timotheus Pokorra |
9aa43bb |
doExtraction = doExtraction && (entryFileName.Length > 0);
|
|
Timotheus Pokorra |
9aa43bb |
}
|
|
Timotheus Pokorra |
9aa43bb |
|