Skip to content

Commit d39aff0

Browse files
maoningcopybara-github
authored andcommitted
Simplify the vuln title for Triton Inference Server RCE.
PiperOrigin-RevId: 635875319 Change-Id: I188e14b1e06f72ef3aee949aa5ad7def5ff4b567
1 parent b8189d0 commit d39aff0

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed

community/detectors/triton_inference_server_model_overwrite/src/main/java/com/google/tsunami/plugins/detectors/rce/TritonInferenceServerRceVulnDetector.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -288,13 +288,13 @@ private DetectionReport buildDetectionReport(
288288
.setPublisher("TSUNAMI_COMMUNITY")
289289
.setValue("TritonInferenceServerRce"))
290290
.setSeverity(Severity.CRITICAL)
291-
.setTitle(
292-
"This detector checks triton inference server RCE with explicit model-control"
293-
+ " option enabled")
291+
.setTitle("Triton Inference Server RCE")
294292
.setDescription(
295-
"All versions of triton inference server with the `--model-control explicit`"
296-
+ " option and at least one loaded model can be overwritten by a malicious"
297-
+ " model and lead to RCE.")
293+
"This detector checks triton inference server RCE with explicit model-control"
294+
+ " option enabled. \n"
295+
+ "All versions of triton inference server with the `--model-control"
296+
+ " explicit` option allows for loaded models to be overwritten by "
297+
+ " malicious models and lead to RCE.")
298298
.setRecommendation("don't use `--model-control explicit` option with public access")
299299
.addRelatedId(
300300
VulnerabilityId.newBuilder().setPublisher("CVE").setValue("CVE-2023-31036")))

community/detectors/triton_inference_server_model_overwrite/src/test/java/com/google/tsunami/plugins/detectors/rce/TritonInferenceServerRceVulnDetectorTest.java

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@
1818

1919
import static com.google.common.truth.extensions.proto.ProtoTruth.assertThat;
2020
import static com.google.tsunami.common.data.NetworkEndpointUtils.forHostnameAndPort;
21-
import static com.google.tsunami.plugins.detectors.rce.TritonInferenceServerRceVulnDetector.*;
21+
import static com.google.tsunami.plugins.detectors.rce.TritonInferenceServerRceVulnDetector.MODEL_CONFIG;
22+
import static com.google.tsunami.plugins.detectors.rce.TritonInferenceServerRceVulnDetector.PYTHON_MODEL;
23+
import static com.google.tsunami.plugins.detectors.rce.TritonInferenceServerRceVulnDetector.UPLOAD_CONFIG_PAYLOAD;
24+
import static com.google.tsunami.plugins.detectors.rce.TritonInferenceServerRceVulnDetector.UPLOAD_MODEL_PAYLOAD;
25+
import static java.nio.charset.StandardCharsets.UTF_8;
2226

2327
import com.google.common.collect.ImmutableList;
2428
import com.google.common.truth.Truth;
@@ -45,7 +49,6 @@
4549
import java.util.Base64;
4650
import java.util.Objects;
4751
import javax.inject.Inject;
48-
4952
import okhttp3.mockwebserver.Dispatcher;
5053
import okhttp3.mockwebserver.MockResponse;
5154
import okhttp3.mockwebserver.MockWebServer;
@@ -120,13 +123,13 @@ public void detect_whenVulnerable_returnsVulnerability() throws IOException {
120123
.setPublisher("TSUNAMI_COMMUNITY")
121124
.setValue("TritonInferenceServerRce"))
122125
.setSeverity(Severity.CRITICAL)
123-
.setTitle(
124-
"This detector checks triton inference server RCE with explicit"
125-
+ " model-control option enabled")
126+
.setTitle("Triton Inference Server RCE")
126127
.setDescription(
127-
"All versions of triton inference server with the `--model-control"
128-
+ " explicit` option and at least one loaded model can be"
129-
+ " overwritten by a malicious model and lead to RCE.")
128+
"This detector checks triton inference server RCE with explicit"
129+
+ " model-control option enabled. \n"
130+
+ "All versions of triton inference server with the"
131+
+ " `--model-control explicit` option allows for loaded models to"
132+
+ " be overwritten by malicious models and lead to RCE.")
130133
.setRecommendation(
131134
"don't use `--model-control explicit` option with public access")
132135
.addRelatedId(
@@ -177,7 +180,7 @@ public MockResponse dispatch(RecordedRequest request) {
177180
UPLOAD_CONFIG_PAYLOAD,
178181
Base64.getEncoder()
179182
.encodeToString(
180-
String.format(MODEL_CONFIG, "metasploit").getBytes())))
183+
String.format(MODEL_CONFIG, "metasploit").getBytes(UTF_8))))
181184
|| request
182185
.getBody()
183186
.readString(StandardCharsets.UTF_8)
@@ -186,7 +189,7 @@ public MockResponse dispatch(RecordedRequest request) {
186189
UPLOAD_MODEL_PAYLOAD,
187190
Base64.getEncoder()
188191
.encodeToString(
189-
PYTHON_MODEL.substring(0, 20).getBytes()))))) {
192+
PYTHON_MODEL.substring(0, 20).getBytes(UTF_8)))))) {
190193
return new MockResponse().setResponseCode(200);
191194
}
192195
}

0 commit comments

Comments
 (0)