apache/camel
Java deserialization callback executes an operating-system commandXML payload declares sensitive file entities
SHA-2562915dbd59c785ce634ee7df18a3862263203186d63c9f642f3069dee8260fee2
Evidence
14:20… for the specific language governing permissions and
15 * limitations under the License.
16 */
17package org.apache.camel.dsl.jbang.it;
18
19import java.awt.Toolkit;
20import java.awt.datatransfer.StringSelection;
21import java.io.BufferedReader;
22import java.io.IOException;
23import java.io.InputStreamReader;
24import java.nio.file.Paths;
25import java.time.Duration;
26import java.util.Date;
27
28import org.apache.camel.dsl.jbang.it.support.JBangTestSupport;
29import org.apache.camel.dsl.jbang.it.support.JiraIssue;
30import org.apache.camel.test.infra.cli.common.CliProperties;
31import org.assertj.core.api.Assertions;
32import org.awaitility.Awaitility;
33import org.junit.jupiter.api.Assumptions;
34import org.junit.jupiter.api.Tag;
35import org.junit.jupiter.api.Test;
36import org.junit.jupiter.api.condition.DisabledIf;
37import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
38import org.junit.jupiter.api.condition.DisabledOnOs;
39import org.junit.jupiter.params.ParameterizedTest;
40import org.junit.jupiter.params.provider.ValueSource;
41
42import static org.junit.jupiter.api.condition.OS.WINDOWS;
43
44public class RunCommandITCase extends JBangTestSupport {
⋯4 lines
95:29… (DEFAULT_MSG);
96 } finally {
97 execInContainer("rm -rf " + dir1 + " " + dir2);
98 }
99 }
⋯4 lines
131:5… public void runRouteFromGistTest() {
132 executeBackground("run https://gist.github.com/davsclaus/477ddff5cdeb1ae03619aa544ce47e92");
133 checkLogContains("Hello Camel from xml");
134 }
⋯4 lines
151:19…
152 .assertThat(Paths.get(getDataFolder()).toFile().listFiles())
153 .as("custom route directory")
154 .extracting("name")
155 .containsExactlyInAnyOrder(" …
178:29… Hello World " + new Date();
179 Toolkit.getDefaultToolkit().getSystemClipboard()
180 .setContents(new StringSelection(
181 String.format("<route><from uri=\"timer:foo\"/><log message=\"%s\"/></route>", msg)), null);
182 final ProcessBuilder builder = new ProcessBuilder(
183 "/bin/bash", "-c",
184 "sshpass -p '" + containerService.getSshPassword()
185 + "' ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -X jbang@localhost -p "
186 + containerService.getSshPort()
187 + " \"" + getMainCommand() + " run clipboard.xml --background && " + getMainCommand()
188 …
Showing the top 5 files — 4 more files (53 regions) not shown.
No evidence locations were recorded for this file. Raw result