Hostile 100% github Download

apache/camel

Java deserialization callback executes an operating-system commandXML payload declares sensitive file entities

Evidence

imports org.junit.jupiter.api.condition.OS.WINDOWS lines 14–48
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
Source contains an rm -rf command lines 95–103
95:29… (DEFAULT_MSG);
96 } finally {
97 execInContainer("rm -rf " + dir1 + " " + dir2);
98 }
99 }
⋯4 lines
Hardcoded gist.github.com host URL lines 131–138
131:5… public void runRouteFromGistTest() {
132 executeBackground("run https://gist.github.com/davsclaus/477ddff5cdeb1ae03619aa544ce47e92");
133 checkLogContains("Hello Camel from xml");
134 }
⋯4 lines
Calls File.listFiles() without a filter lines 151–155
151:19…
152 .assertThat(Paths.get(getDataFolder()).toFile().listFiles())
153 .as("custom route directory")
154 .extracting("name")
155 .containsExactlyInAnyOrder(" …
Java SSH disables host key checks lines 178–188
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

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.