This is an automated email from the ASF dual-hosted git repository. coheigea pushed a commit to branch camel-3.11.x in repository https://gitbox.apache.org/repos/asf/camel.git
commit 81c10d11e87c92f7a712d56874412ea7301d0c53 Author: Colm O hEigeartaigh <[email protected]> AuthorDate: Wed Jan 26 07:53:12 2022 +0000 Make sure the tmpdir can't be bypassed --- .../src/main/java/org/apache/camel/component/jira/FileConverter.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/camel-jira/src/main/java/org/apache/camel/component/jira/FileConverter.java b/components/camel-jira/src/main/java/org/apache/camel/component/jira/FileConverter.java index 11048af..587dd24 100644 --- a/components/camel-jira/src/main/java/org/apache/camel/component/jira/FileConverter.java +++ b/components/camel-jira/src/main/java/org/apache/camel/component/jira/FileConverter.java @@ -38,6 +38,9 @@ public final class FileConverter { if (body instanceof byte[]) { byte[] bos = (byte[]) body; String destDir = System.getProperty("java.io.tmpdir"); + if (!destDir.endsWith(File.separator)) { + destDir += File.separator; + } file = new File(destDir, genericFile.getFileName()); if (!file.getCanonicalPath().startsWith(destDir)) { throw new IOException("File is not jailed to the destination directory");
