Skip to content

Commit 02f7d1c

Browse files
committed
cleanup comments
1 parent d0c7fff commit 02f7d1c

2 files changed

Lines changed: 11 additions & 16 deletions

File tree

qa/L0_vertex_ai/test.sh

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -699,20 +699,14 @@ else
699699
fi
700700
set -e
701701

702-
# repository control (expect error)
702+
# repository control via redirect is blocked unconditionally
703703
rm -f ./curl.out
704704
set +e
705705
code=`curl -s -w %{http_code} -o ./curl.out -X POST -H "X-Vertex-Ai-Triton-Redirect: v2/repository/models/subadd/unload" localhost:8080/predict`
706-
if [ "$code" == "200" ]; then
706+
if [ "$code" != "403" ]; then
707707
cat ./curl.out
708-
echo -e "\n***\n*** Test Failed\n***"
708+
echo -e "\n***\n*** Failed. Expected model unload via redirect to return 403 (got $code)\n***"
709709
RET=1
710-
else
711-
grep "explicit model load / unload is not allowed" ./curl.out
712-
if [ $? -ne 0 ]; then
713-
echo -e "\n***\n*** Failed. Expected error on model control\n***"
714-
RET=1
715-
fi
716710
fi
717711
set -e
718712

@@ -813,8 +807,7 @@ if [ "$code" != "403" ]; then
813807
RET=1
814808
fi
815809

816-
# Model load redirect is unconditionally blocked through the prediction
817-
# endpoint regardless of restricted header configuration (TRI-715 RCE vector)
810+
# Model load redirect is unconditionally blocked through the prediction endpoint
818811
rm -f ./curl.out
819812
code=`curl -s -w %{http_code} -o ./curl.out -X POST -H "X-Vertex-Ai-Triton-Redirect: v2/repository/models/identity_fp32/load" localhost:8080/predict`
820813
if [ "$code" != "403" ]; then
@@ -823,7 +816,7 @@ if [ "$code" != "403" ]; then
823816
RET=1
824817
fi
825818

826-
# Model unload redirect is unconditionally blocked (TRI-715 DoS vector)
819+
# Model unload redirect is unconditionally blocked through the prediction endpoint
827820
rm -f ./curl.out
828821
code=`curl -s -w %{http_code} -o ./curl.out -X POST -H "X-Vertex-Ai-Triton-Redirect: v2/repository/models/identity_fp32/unload" localhost:8080/predict`
829822
if [ "$code" != "403" ]; then
@@ -941,7 +934,7 @@ export AIP_PREDICT_ROUTE="/predict"
941934
export AIP_HEALTH_ROUTE="/health"
942935

943936
SERVER_LOG="vertex_max_input_size_server.log"
944-
SERVER_ARGS="--allow-vertex-ai=true --model-repository=restricted_single_model --vertex-ai-default-model=identity_fp32 --http-max-input-size=256"
937+
SERVER_ARGS="--allow-vertex-ai=true --model-repository=restricted_single_model --vertex-ai-default-model=identity_fp32 --http-max-input-size=128"
945938
run_server_nowait
946939
vertex_ai_wait_for_server_ready $SERVER_PID 10
947940
if [ "$WAIT_RET" != "0" ]; then

src/vertex_ai_server.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,9 @@ VertexAiAPIServer::Handle(evhtp_request_t* req)
201201
HandleSystemSharedMemory(req, region, action);
202202
return;
203203
}
204-
// register/unregister are mutating operations that must not be
205-
// reachable through the prediction endpoint.
204+
// Only read-only status queries are permitted through redirect.
205+
// Mutating operations (register/unregister) require the core
206+
// HTTP endpoint.
206207
LOG_VERBOSE(1) << "Vertex AI redirect blocked: " << redirect_endpoint;
207208
evhtp_send_reply(req, EVHTP_RES_FORBIDDEN);
208209
return;
@@ -224,7 +225,8 @@ VertexAiAPIServer::Handle(evhtp_request_t* req)
224225
HandleRepositoryIndex(req, repo_name);
225226
return;
226227
}
227-
// Model load/unload must not be reachable through the prediction endpoint.
228+
// Only repository index queries are permitted through redirect.
229+
// Model load/unload requires the core HTTP endpoint.
228230
LOG_VERBOSE(1) << "Vertex AI redirect blocked: " << redirect_endpoint;
229231
evhtp_send_reply(req, EVHTP_RES_FORBIDDEN);
230232
return;

0 commit comments

Comments
 (0)