diff --git a/src/main/java/org/sasanlabs/service/vulnerability/fileupload/UnrestrictedFileUpload.java b/src/main/java/org/sasanlabs/service/vulnerability/fileupload/UnrestrictedFileUpload.java index 0e05276f..adb5f95d 100644 --- a/src/main/java/org/sasanlabs/service/vulnerability/fileupload/UnrestrictedFileUpload.java +++ b/src/main/java/org/sasanlabs/service/vulnerability/fileupload/UnrestrictedFileUpload.java @@ -92,10 +92,10 @@ public UnrestrictedFileUpload() throws IOException, URISyntaxException { "If you are running vulnerableApp as a Jar then UnrestrictedFileUpload will not work. " + "For more information: https://github.com/SasanLabs/VulnerableApp/issues/255", e); - if (root != null) { + if (root == null || !root.toFile().exists()) { root = Files.createTempDirectory(null); } - if (contentDispositionRoot != null) { + if (contentDispositionRoot == null || !contentDispositionRoot.toFile().exists()) { contentDispositionRoot = Files.createTempDirectory(null); } }