diff --git a/src/android/Zip.java b/src/android/Zip.java index 7afe3103..e4c18a9d 100644 --- a/src/android/Zip.java +++ b/src/android/Zip.java @@ -127,7 +127,8 @@ private void unzipSync(CordovaArgs args, CallbackContext callbackContext) { } else { File file = new File(outputDirectory + compressedName); String canonicalPath = file.getCanonicalPath(); - if (!canonicalPath.startsWith(outputDirectory)) { + String absolutePath = file.getAbsolutePath(); + if (!canonicalPath.startsWith(outputDirectory) && !absolutePath.startsWith(outputDirectory)) { String errorMessage = "Zip traversal security error"; callbackContext.error(errorMessage); Log.e(LOG_TAG, errorMessage);