diff --git a/cws-service/src/main/java/jpl/cws/controller/RestService.java b/cws-service/src/main/java/jpl/cws/controller/RestService.java index f3c8664f..fcb46a5a 100644 --- a/cws-service/src/main/java/jpl/cws/controller/RestService.java +++ b/cws-service/src/main/java/jpl/cws/controller/RestService.java @@ -299,7 +299,12 @@ public ModelAndView getInitiatorsHtmlTable() { public @ResponseBody String deployModelerFile( @RequestParam("filename") String filename, @RequestParam("xmlData") String xmlData) { - + + // Don't allow filename to contain path modifiers + if (filename.contains("..") || filename.contains("/") || filename.contains("\\")) { + return "ERROR: Input filename '" + filename + "' cannot contain any path modifiers"; + } + BufferedWriter bufferedWriter = null; File f = null; try { diff --git a/cws-service/src/main/java/jpl/cws/process/initiation/InitiatorsService.java b/cws-service/src/main/java/jpl/cws/process/initiation/InitiatorsService.java index 0adf0708..2748c7ba 100644 --- a/cws-service/src/main/java/jpl/cws/process/initiation/InitiatorsService.java +++ b/cws-service/src/main/java/jpl/cws/process/initiation/InitiatorsService.java @@ -29,6 +29,7 @@ import org.xmlunit.builder.DiffBuilder; import org.xmlunit.diff.Diff; +import javax.xml.XMLConstants; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.transform.OutputKeys; @@ -225,6 +226,7 @@ public void updateChangedInitiators(String newXmlContext) throws Exception { waitForWorkingFileWrite(newXmlContext); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); DocumentBuilder db = dbf.newDocumentBuilder(); // Load the files diff --git a/pom.xml b/pom.xml index 07d5553d..502d110d 100644 --- a/pom.xml +++ b/pom.xml @@ -20,16 +20,16 @@ - 5.14.5 + 5.15.9 3.1.4 2.15.47 7.13.0 1.9.0 - 1.5 + 1.18 1.10 1.3 - 1.3.1 + 1.3.3 2.4 2.6 1.3.2 @@ -54,7 +54,7 @@ 2.6 1.1 2.1 - 4.12 + 4.13.1 2.7.1b3 2.6.1 @@ -68,10 +68,10 @@ 2.22.0 1.9.5 3.5.3 - 5.1.26 + 8.0.16 1.0.4 UTF-8 - 2.2.1 + 2.3.2 3.14.0 3.1.0 1.7.26