This is an automated email from the ASF dual-hosted git repository.
coheigea pushed a commit to branch camel-3.14.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-3.14.x by this push:
new d428373 Make sure the tmpdir can't be bypassed
d428373 is described below
commit d4283730a00ad0377c16ecb3c578506496d5d97f
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");