From 5dbbd5ea093442bbbb3a96985f74ffc23bdca8b7 Mon Sep 17 00:00:00 2001 From: Robert Dick Date: Thu, 23 Apr 2026 10:26:45 -0400 Subject: [PATCH 1/4] converted agentscope CVE-2024-8438 plugin to templated --- .../agentscope_cve_2024_8438/README.md | 19 -- .../agentscope_cve_2024_8438/build.gradle | 37 ---- .../agentscope_cve_2024_8438/settings.gradle | 12 -- .../cve/cve20248438/Cve20248438Detector.java | 174 ------------------ .../Cve20248438DetectorBootstrapModule.java | 32 ---- .../cve20248438/Cve20248438DetectorTest.java | 133 ------------- .../2024/AgentScope_CVE_2024_8438.textproto | 67 +++++++ .../AgentScope_CVE_2024_8438_test.textproto | 65 +++++++ 8 files changed, 132 insertions(+), 407 deletions(-) delete mode 100644 community/detectors/agentscope_cve_2024_8438/README.md delete mode 100644 community/detectors/agentscope_cve_2024_8438/build.gradle delete mode 100644 community/detectors/agentscope_cve_2024_8438/settings.gradle delete mode 100644 community/detectors/agentscope_cve_2024_8438/src/main/java/com/google/tsunami/plugins/detectors/cve/cve20248438/Cve20248438Detector.java delete mode 100644 community/detectors/agentscope_cve_2024_8438/src/main/java/com/google/tsunami/plugins/detectors/cve/cve20248438/Cve20248438DetectorBootstrapModule.java delete mode 100644 community/detectors/agentscope_cve_2024_8438/src/test/java/com/google/tsunami/plugins/detectors/cve/cve20248438/Cve20248438DetectorTest.java create mode 100644 templated/templateddetector/plugins/cve/2024/AgentScope_CVE_2024_8438.textproto create mode 100644 templated/templateddetector/plugins/cve/2024/AgentScope_CVE_2024_8438_test.textproto diff --git a/community/detectors/agentscope_cve_2024_8438/README.md b/community/detectors/agentscope_cve_2024_8438/README.md deleted file mode 100644 index 2fe7514eb..000000000 --- a/community/detectors/agentscope_cve_2024_8438/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# Agentscope Studio Arbitrary File Download Detector - -This plugin for Tsunami detects publicly exposed agentscope studio instances. -The /api/file endpoint in modelscope/agentscope is vulnerable to Arbitrary File -Download, allowing attackers to retrieve internal files without restriction. -This could lead to the unintended exposure of sensitive information, including -configuration files that contain database credentials. - -References: - https://huntr.com/bounties/3f170c58-42ee-422d-ab6f-32c7aa05b974 - -## Build jar file for this plugin - -Using `gradlew`: - -```shell -./gradlew jar -``` - -Tsunami identifiable jar file is located at `build/libs` directory. diff --git a/community/detectors/agentscope_cve_2024_8438/build.gradle b/community/detectors/agentscope_cve_2024_8438/build.gradle deleted file mode 100644 index 14efe8b07..000000000 --- a/community/detectors/agentscope_cve_2024_8438/build.gradle +++ /dev/null @@ -1,37 +0,0 @@ -plugins { - id 'java-library' -} - -description = 'Tsunami CVE-2024-8438 VulnDetector plugin.' -group = 'com.google.tsunami' -version = '0.0.1-SNAPSHOT' - -repositories { - maven { // The google mirror is less flaky than mavenCentral() - url 'https://maven-central.storage-download.googleapis.com/repos/central/data/' - } - mavenCentral() - mavenLocal() -} - -def coreRepoBranch = System.getenv("GITBRANCH_TSUNAMI_CORE") ?: "stable" -def tcsRepoBranch = System.getenv("GITBRANCH_TSUNAMI_TCS") ?: "stable" - -dependencies { - implementation("com.google.tsunami:tsunami-common") { - version { branch = "${coreRepoBranch}" } - } - implementation("com.google.tsunami:tsunami-plugin") { - version { branch = "${coreRepoBranch}" } - } - implementation("com.google.tsunami:tsunami-proto") { - version { branch = "${coreRepoBranch}" } - } - - testImplementation "junit:junit:4.13.2" - testImplementation "org.mockito:mockito-core:5.18.0" - testImplementation "com.google.truth:truth:1.4.4" - testImplementation "com.google.truth.extensions:truth-java8-extension:1.4.4" - testImplementation "com.google.truth.extensions:truth-proto-extension:1.4.4" - testImplementation "com.squareup.okhttp3:mockwebserver:3.12.0" -} diff --git a/community/detectors/agentscope_cve_2024_8438/settings.gradle b/community/detectors/agentscope_cve_2024_8438/settings.gradle deleted file mode 100644 index 82f5ba115..000000000 --- a/community/detectors/agentscope_cve_2024_8438/settings.gradle +++ /dev/null @@ -1,12 +0,0 @@ -rootProject.name = 'CVE-2024-8438' - -def coreRepository = System.getenv("GITREPO_TSUNAMI_CORE") ?: "https://github.com/google/tsunami-security-scanner.git" -def tcsRepository = System.getenv("GITREPO_TSUNAMI_TCS") ?: "https://github.com/google/tsunami-security-scanner-callback-server.git" - -sourceControl { - gitRepository("${coreRepository}") { - producesModule("com.google.tsunami:tsunami-common") - producesModule("com.google.tsunami:tsunami-plugin") - producesModule("com.google.tsunami:tsunami-proto") - } -} \ No newline at end of file diff --git a/community/detectors/agentscope_cve_2024_8438/src/main/java/com/google/tsunami/plugins/detectors/cve/cve20248438/Cve20248438Detector.java b/community/detectors/agentscope_cve_2024_8438/src/main/java/com/google/tsunami/plugins/detectors/cve/cve20248438/Cve20248438Detector.java deleted file mode 100644 index cbafd79d3..000000000 --- a/community/detectors/agentscope_cve_2024_8438/src/main/java/com/google/tsunami/plugins/detectors/cve/cve20248438/Cve20248438Detector.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright 2025 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.tsunami.plugins.detectors.cve.cve20248438; - -import static com.google.common.base.Preconditions.checkNotNull; -import static com.google.common.collect.ImmutableList.toImmutableList; -import static com.google.common.net.HttpHeaders.USER_AGENT; -import static com.google.tsunami.common.net.http.HttpRequest.get; - -import com.google.common.annotations.VisibleForTesting; -import com.google.common.collect.ImmutableList; -import com.google.common.flogger.GoogleLogger; -import com.google.protobuf.util.Timestamps; -import com.google.tsunami.common.data.NetworkServiceUtils; -import com.google.tsunami.common.net.http.HttpClient; -import com.google.tsunami.common.net.http.HttpHeaders; -import com.google.tsunami.common.net.http.HttpResponse; -import com.google.tsunami.common.net.http.HttpStatus; -import com.google.tsunami.common.time.UtcClock; -import com.google.tsunami.plugin.PluginType; -import com.google.tsunami.plugin.VulnDetector; -import com.google.tsunami.plugin.annotations.PluginInfo; -import com.google.tsunami.proto.DetectionReport; -import com.google.tsunami.proto.DetectionReportList; -import com.google.tsunami.proto.DetectionStatus; -import com.google.tsunami.proto.NetworkService; -import com.google.tsunami.proto.Severity; -import com.google.tsunami.proto.TargetInfo; -import com.google.tsunami.proto.Vulnerability; -import com.google.tsunami.proto.VulnerabilityId; -import java.io.IOException; -import java.time.Clock; -import java.time.Instant; -import java.util.regex.Pattern; -import javax.inject.Inject; - -/** A {@link VulnDetector} that detects the CVE-2024-8438 . */ -@PluginInfo( - type = PluginType.VULN_DETECTION, - name = "Cve20248438Detector", - version = "0.1", - description = Cve20248438Detector.VULN_DESCRIPTION, - author = "rdj (rdj@crackatoa.id)", - bootstrapModule = Cve20248438DetectorBootstrapModule.class) -public final class Cve20248438Detector implements VulnDetector { - - @VisibleForTesting static final Pattern DETECTION_PATTERN = Pattern.compile("(root:[x*]:0:0:)"); - - @VisibleForTesting - static final String VULN_DESCRIPTION = - "Agentscope studio version 0.1.1 and prior is vulnerable to Arbitrary File Download via" - + " api/file"; - - private static final GoogleLogger logger = GoogleLogger.forEnclosingClass(); - - private final Clock utcClock; - - private final HttpClient httpClient; - - private static final String VUL_PATH = "/api/file?"; - - private static final String GET_DATA = "path=/etc/passwd"; - - @Inject - Cve20248438Detector(@UtcClock Clock utcClock, HttpClient httpClient) { - this.utcClock = checkNotNull(utcClock); - this.httpClient = checkNotNull(httpClient); - } - - @Override - public ImmutableList getAdvisories() { - return ImmutableList.of( - Vulnerability.newBuilder() - .setMainId( - VulnerabilityId.newBuilder() - .setPublisher("TSUNAMI_COMMUNITY") - .setValue("CVE-2024-8438")) - .addRelatedId( - VulnerabilityId.newBuilder().setPublisher("CVE").setValue("CVE-2024-8438")) - .setSeverity(Severity.HIGH) - .setTitle("CVE-2024-8438 Agentscope Studio API Arbitrary File Download") - .setDescription(VULN_DESCRIPTION) - .setRecommendation( - "Ensure this service is not exposed to the public internet. Restrict access" - + " using firewall rules, VPN, or an allowlist to limit exposure to only" - + " trusted users and networks.") - .build()); - } - - @Override - public DetectionReportList detect( - TargetInfo targetInfo, ImmutableList matchedServices) { - logger.atInfo().log("CVE-2024-8438 starts detecting."); - - return DetectionReportList.newBuilder() - .addAllDetectionReports( - matchedServices.stream() - .filter(NetworkServiceUtils::isWebService) - .filter(this::isAgentscopeWebApplication) - .filter(this::isServiceVulnerable) - .map(networkService -> buildDetectionReport(targetInfo, networkService)) - .collect(toImmutableList())) - .build(); - } - - private boolean isAgentscopeWebApplication(NetworkService networkService) { - try { - String agentScopeUrl = NetworkServiceUtils.buildWebApplicationRootUrl(networkService); - HttpResponse httpResponse = - httpClient.send( - get(agentScopeUrl) - .setHeaders( - HttpHeaders.builder().addHeader(USER_AGENT, "TSUNAMI_SCANNER").build()) - .build(), - networkService); - return httpResponse.status() == HttpStatus.OK - && httpResponse.bodyString().isPresent() - && httpResponse.bodyString().get().contains("AgentScope Studio"); - - } catch (RuntimeException | IOException e) { - logger.atWarning().withCause(e).log( - "Request to target %s failed", - NetworkServiceUtils.buildWebApplicationRootUrl(networkService)); - return false; - } - } - - private boolean isServiceVulnerable(NetworkService networkService) { - String targetVulnerabilityUrl = - NetworkServiceUtils.buildWebApplicationRootUrl(networkService) + VUL_PATH + GET_DATA; - try { - HttpResponse httpResponse = - httpClient.sendAsIs( - get(targetVulnerabilityUrl) - .setHeaders( - HttpHeaders.builder().addHeader(USER_AGENT, "TSUNAMI_SCANNER").build()) - .build()); - if (httpResponse.status() == HttpStatus.OK && httpResponse.bodyString().isPresent()) { - if (DETECTION_PATTERN.matcher(httpResponse.bodyString().get()).find()) { - return true; - } - } - } catch (IOException | AssertionError e) { - logger.atWarning().withCause(e).log("Request to target %s failed", networkService); - return false; - } - return false; - } - - private DetectionReport buildDetectionReport( - TargetInfo targetInfo, NetworkService vulnerableNetworkService) { - return DetectionReport.newBuilder() - .setTargetInfo(targetInfo) - .setNetworkService(vulnerableNetworkService) - .setDetectionTimestamp(Timestamps.fromMillis(Instant.now(utcClock).toEpochMilli())) - .setDetectionStatus(DetectionStatus.VULNERABILITY_VERIFIED) - .setVulnerability(getAdvisories().get(0)) - .build(); - } -} diff --git a/community/detectors/agentscope_cve_2024_8438/src/main/java/com/google/tsunami/plugins/detectors/cve/cve20248438/Cve20248438DetectorBootstrapModule.java b/community/detectors/agentscope_cve_2024_8438/src/main/java/com/google/tsunami/plugins/detectors/cve/cve20248438/Cve20248438DetectorBootstrapModule.java deleted file mode 100644 index de2c34d39..000000000 --- a/community/detectors/agentscope_cve_2024_8438/src/main/java/com/google/tsunami/plugins/detectors/cve/cve20248438/Cve20248438DetectorBootstrapModule.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2025 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.tsunami.plugins.detectors.cve.cve20248438; - -import com.google.tsunami.plugin.PluginBootstrapModule; - -/** An example Guice module that bootstraps the {@link Cve20248438Detector}. */ -public final class Cve20248438DetectorBootstrapModule extends PluginBootstrapModule { - - @Override - protected void configurePlugin() { - // Tsunami relies heavily on Guice (https://github.com/google/guice). All Guice bindings for - // your plugin should be implemented here. - - // registerPlugin method is required in order for the Tsunami scanner to identify your plugin. - registerPlugin(Cve20248438Detector.class); - } -} diff --git a/community/detectors/agentscope_cve_2024_8438/src/test/java/com/google/tsunami/plugins/detectors/cve/cve20248438/Cve20248438DetectorTest.java b/community/detectors/agentscope_cve_2024_8438/src/test/java/com/google/tsunami/plugins/detectors/cve/cve20248438/Cve20248438DetectorTest.java deleted file mode 100644 index a7ba9edd8..000000000 --- a/community/detectors/agentscope_cve_2024_8438/src/test/java/com/google/tsunami/plugins/detectors/cve/cve20248438/Cve20248438DetectorTest.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright 2025 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.tsunami.plugins.detectors.cve.cve20248438; - -import static com.google.common.truth.extensions.proto.ProtoTruth.assertThat; -import static com.google.tsunami.common.data.NetworkEndpointUtils.forHostname; -import static com.google.tsunami.common.data.NetworkEndpointUtils.forHostnameAndPort; - -import com.google.common.collect.ImmutableList; -import com.google.inject.Guice; -import com.google.protobuf.util.Timestamps; -import com.google.tsunami.common.net.http.HttpClientModule; -import com.google.tsunami.common.time.testing.FakeUtcClock; -import com.google.tsunami.common.time.testing.FakeUtcClockModule; -import com.google.tsunami.proto.DetectionReport; -import com.google.tsunami.proto.DetectionReportList; -import com.google.tsunami.proto.DetectionStatus; -import com.google.tsunami.proto.NetworkService; -import com.google.tsunami.proto.Software; -import com.google.tsunami.proto.TargetInfo; -import com.google.tsunami.proto.TransportProtocol; -import java.io.IOException; -import java.time.Instant; -import javax.inject.Inject; -import okhttp3.mockwebserver.MockResponse; -import okhttp3.mockwebserver.MockWebServer; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - -/** Unit tests for {@link Cve20248438Detector}. */ -@RunWith(JUnit4.class) -public final class Cve20248438DetectorTest { - // Tsunami provides several testing utilities to make your lives easier with unit test. - private final FakeUtcClock fakeUtcClock = - FakeUtcClock.create().setNow(Instant.parse("2020-01-01T00:00:00.00Z")); - - @Inject private Cve20248438Detector detector; - - private MockWebServer mockWebServer; - private NetworkService service; - private TargetInfo targetInfo; - - @Before - public void setUp() { - mockWebServer = new MockWebServer(); - Guice.createInjector( - new FakeUtcClockModule(fakeUtcClock), - new Cve20248438DetectorBootstrapModule(), - new HttpClientModule.Builder().build()) - .injectMembers(this); - - service = - NetworkService.newBuilder() - .setNetworkEndpoint( - forHostnameAndPort(mockWebServer.getHostName(), mockWebServer.getPort())) - .setTransportProtocol(TransportProtocol.TCP) - .setSoftware(Software.newBuilder().setName("AgentScope Studio")) - .setServiceName("http") - .build(); - - targetInfo = - TargetInfo.newBuilder() - .addNetworkEndpoints(forHostname(mockWebServer.getHostName())) - .build(); - } - - @After - public void tearDown() throws IOException { - mockWebServer.shutdown(); - } - - @Test - public void detect_whenVulnerable_returnsVulnerability() throws IOException { - mockWebServer.enqueue( - new MockResponse().setBody("AgentScope Studio").setResponseCode(200)); - - mockWebServer.enqueue( - new MockResponse().setBody("root:x:0:0:root:/root:/bin/bash").setResponseCode(200)); - - DetectionReport actual = - detector.detect(targetInfo, ImmutableList.of(service)).getDetectionReports(0); - - DetectionReport expected = - DetectionReport.newBuilder() - .setTargetInfo(targetInfo) - .setNetworkService(service) - .setDetectionTimestamp(Timestamps.fromMillis(Instant.now(fakeUtcClock).toEpochMilli())) - .setDetectionStatus(DetectionStatus.VULNERABILITY_VERIFIED) - .setVulnerability(detector.getAdvisories().get(0)) - .build(); - assertThat(actual).isEqualTo(expected); - } - - @Test - public void detect_whenNotVulnerable_returnsNoVulnerability() throws IOException { - MockResponse response = new MockResponse().setBody("Hello World").setResponseCode(200); - mockWebServer.enqueue(response); - - ImmutableList httpServices = - ImmutableList.of( - NetworkService.newBuilder() - .setNetworkEndpoint( - forHostnameAndPort(mockWebServer.getHostName(), mockWebServer.getPort())) - .setTransportProtocol(TransportProtocol.TCP) - .setServiceName("http") - .build()); - TargetInfo targetInfo = - TargetInfo.newBuilder() - .addNetworkEndpoints(forHostname(mockWebServer.getHostName())) - .build(); - - DetectionReportList detectionReports = detector.detect(targetInfo, httpServices); - - assertThat(detectionReports.getDetectionReportsList()).isEmpty(); - } -} diff --git a/templated/templateddetector/plugins/cve/2024/AgentScope_CVE_2024_8438.textproto b/templated/templateddetector/plugins/cve/2024/AgentScope_CVE_2024_8438.textproto new file mode 100644 index 000000000..5c4f9525c --- /dev/null +++ b/templated/templateddetector/plugins/cve/2024/AgentScope_CVE_2024_8438.textproto @@ -0,0 +1,67 @@ +# proto-file: proto/templated_plugin.proto +# proto-message: TemplatedPlugin + +############### +# PLUGIN INFO # +############### + +info: { + type: VULN_DETECTION + name: "AgentScope_CVE_2024_8438" + author: + "Robert Dick (robert@doyensec.com) for the Templated version," + " rdj (rdj@crackatoa.id) for the original Java version" + version: "2.0" +} + +finding: { + main_id: { + publisher: "GOOGLE" + value: "AgentScope_CVE_2024_8438" + } + severity: HIGH + title: "CVE-2024-8438 Agentscope Studio API Arbitrary File Download" + description: + "Agentscope studio version 0.1.1 and prior is vulnerable to Arbitrary File Download via" + " api/file" + recommendation: + "Ensure this service is not exposed to the public internet. Restrict access" + " using firewall rules, VPN, or an allowlist to limit exposure to only" + " trusted users and networks." + related_id: { + publisher: "CVE" + value: "CVE-2024-8438" + } +} + +########### +# ACTIONS # +########### + +actions: { + name: "read_etc_passwd" + http_request: { + method: GET + uri: "/api/file?path=/etc/passwd" + response: { + http_status: 200 + expect_all { + conditions: [ + { body: {} contains: 'root:' }, + { header: { name: "Content-Disposition" } contains: "filename=passwd"} + ] + } + } + } +} + +############# +# WORKFLOWS # +############# + +workflows: { + actions: [ + "read_etc_passwd" + ] +} + diff --git a/templated/templateddetector/plugins/cve/2024/AgentScope_CVE_2024_8438_test.textproto b/templated/templateddetector/plugins/cve/2024/AgentScope_CVE_2024_8438_test.textproto new file mode 100644 index 000000000..5bda5d899 --- /dev/null +++ b/templated/templateddetector/plugins/cve/2024/AgentScope_CVE_2024_8438_test.textproto @@ -0,0 +1,65 @@ +# proto-file: proto/templated_plugin_tests.proto +# proto-message: TemplatedPluginTests + +config: { + tested_plugin: "AgentScope_CVE_2024_8438" + disabled: false +} + +tests: { + name: "whenAgentScopeVulnerable_returnsTrue" + expect_vulnerability: true + + mock_http_server: { + mock_responses: [ + { + uri: "/" + status: 200 + body_content: '... AgentScope ...' + }, + { + uri: "/api/file?path=/etc/passwd" + status: 200 + body_content: + "nobody:*:-2:-2:Unprivileged User:/var/empty:/usr/bin/false\n" + "root:x:0:0:System Administrator:/var/root:/bin/sh" + headers: { name: "Content-Disposition" value: "inline; filename=passwd"} + } + ] + } +} + +tests: { + name: "whenAgentScopeNotVulnerable_returnsFalse" + expect_vulnerability: false + + mock_http_server: { + mock_responses: [ + { + uri: "/" + status: 200 + body_content: '... AgentScope ...' + }, + { + uri: "TSUNAMI_MAGIC_ANY_URI" + status: 403 + body_content: 'Forbidden' + } + ] + } +} + +tests: { + name: "whenNotMLFlow_returnsFalse" + expect_vulnerability: false + + mock_http_server: { + mock_responses: [ + { + uri: "TSUNAMI_MAGIC_ANY_URI" + status: 200 + body_content: "Login to your Drupal account" + } + ] + } +} From dd090cd24d2fede699a034b52e72fa28bf9ea9af Mon Sep 17 00:00:00 2001 From: Robert Dick Date: Fri, 1 May 2026 03:19:48 -0400 Subject: [PATCH 2/4] fixed test case name --- .../plugins/cve/2024/AgentScope_CVE_2024_8438_test.textproto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templated/templateddetector/plugins/cve/2024/AgentScope_CVE_2024_8438_test.textproto b/templated/templateddetector/plugins/cve/2024/AgentScope_CVE_2024_8438_test.textproto index 5bda5d899..cb1a6a723 100644 --- a/templated/templateddetector/plugins/cve/2024/AgentScope_CVE_2024_8438_test.textproto +++ b/templated/templateddetector/plugins/cve/2024/AgentScope_CVE_2024_8438_test.textproto @@ -50,7 +50,7 @@ tests: { } tests: { - name: "whenNotMLFlow_returnsFalse" + name: "whenNotAgentScope_returnsFalse" expect_vulnerability: false mock_http_server: { From 4c4023806d16177bda1bf2aae17286ec5ee2f728 Mon Sep 17 00:00:00 2001 From: Robert Dick Date: Wed, 3 Jun 2026 02:12:37 -0400 Subject: [PATCH 3/4] implemented suggested changes --- community/README.md | 2 +- .../2024/AgentScope_CVE_2024_8438.textproto | 18 ++++++++++++++++++ .../AgentScope_CVE_2024_8438_test.textproto | 4 ++-- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/community/README.md b/community/README.md index e651c1cea..7fbdfda3e 100644 --- a/community/README.md +++ b/community/README.md @@ -22,7 +22,7 @@ This directory contains plugins contributed by community members. #### Arbitrary File Read -* [CVE-2024-8438 Agentscope Studio Arbitrary File Download Detector](https://github.com/google/tsunami-security-scanner-plugins/tree/master/community/detectors/agentscope_cve_2024_8438) +* [CVE-2024-8438 Agentscope Studio Arbitrary File Download Detector, now updated to Templated format](https://github.com/google/tsunami-security-scanner-plugins/tree/master/templated/templateddetector/plugins/cve/2024/AgentScope_CVE_2024_8438.textproto) #### Remote Code Execution diff --git a/templated/templateddetector/plugins/cve/2024/AgentScope_CVE_2024_8438.textproto b/templated/templateddetector/plugins/cve/2024/AgentScope_CVE_2024_8438.textproto index 5c4f9525c..517a9ba67 100644 --- a/templated/templateddetector/plugins/cve/2024/AgentScope_CVE_2024_8438.textproto +++ b/templated/templateddetector/plugins/cve/2024/AgentScope_CVE_2024_8438.textproto @@ -38,6 +38,22 @@ finding: { # ACTIONS # ########### +actions: { + name: "fingerprint_agentscope" + http_request: { + method: GET + uri: "/" + response: { + http_status: 200 + expect_all { + conditions: [ + { body: {} contains: 'AgentScope Studio' } + ] + } + } + } +} + actions: { name: "read_etc_passwd" http_request: { @@ -48,6 +64,7 @@ actions: { expect_all { conditions: [ { body: {} contains: 'root:' }, + { body: {} contains: ':0:0:' }, { header: { name: "Content-Disposition" } contains: "filename=passwd"} ] } @@ -61,6 +78,7 @@ actions: { workflows: { actions: [ + "fingerprint_agentscope", "read_etc_passwd" ] } diff --git a/templated/templateddetector/plugins/cve/2024/AgentScope_CVE_2024_8438_test.textproto b/templated/templateddetector/plugins/cve/2024/AgentScope_CVE_2024_8438_test.textproto index cb1a6a723..6d31973f9 100644 --- a/templated/templateddetector/plugins/cve/2024/AgentScope_CVE_2024_8438_test.textproto +++ b/templated/templateddetector/plugins/cve/2024/AgentScope_CVE_2024_8438_test.textproto @@ -15,7 +15,7 @@ tests: { { uri: "/" status: 200 - body_content: '... AgentScope ...' + body_content: '... AgentScope Studio ...' }, { uri: "/api/file?path=/etc/passwd" @@ -38,7 +38,7 @@ tests: { { uri: "/" status: 200 - body_content: '... AgentScope ...' + body_content: '... AgentScope Studio ...' }, { uri: "TSUNAMI_MAGIC_ANY_URI" From e94126c0941cbcdd5c6532edd0b3334b63c7df30 Mon Sep 17 00:00:00 2001 From: Robert Dick Date: Thu, 11 Jun 2026 06:37:46 -0400 Subject: [PATCH 4/4] fixed identifier --- .../plugins/cve/2024/AgentScope_CVE_2024_8438.textproto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templated/templateddetector/plugins/cve/2024/AgentScope_CVE_2024_8438.textproto b/templated/templateddetector/plugins/cve/2024/AgentScope_CVE_2024_8438.textproto index 517a9ba67..fd3d749e7 100644 --- a/templated/templateddetector/plugins/cve/2024/AgentScope_CVE_2024_8438.textproto +++ b/templated/templateddetector/plugins/cve/2024/AgentScope_CVE_2024_8438.textproto @@ -16,7 +16,7 @@ info: { finding: { main_id: { - publisher: "GOOGLE" + publisher: "TSUNAMI_COMMUNITY" value: "AgentScope_CVE_2024_8438" } severity: HIGH