Commit 187eecb
Pravali Uppugunduri
fix: Add HMAC integrity verification for Triton inference handler
- Add HMAC integrity check before pickle deserialization in TritonPythonModel.initialize()
- Replace hardcoded secret key with generate_secret_key() in _prepare_for_triton() ONNX path
- Add _hmac_signing() after ONNX export for both PyTorch and TensorFlow frameworks
- Add secret key validation in _start_triton_server() to reject None/empty keys
Fixes RCE vulnerabilities in Triton handler by aligning with HMAC verification
patterns used by TorchServe, MMS, TF Serving, and SMD handlers.1 parent 6a174f4 commit 187eecb
File tree
4 files changed
+40
-7
lines changed- sagemaker-serve
- src/sagemaker/serve
- model_server/triton
- tests/unit
4 files changed
+40
-7
lines changedLines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2879 | 2879 | | |
2880 | 2880 | | |
2881 | 2881 | | |
2882 | | - | |
| 2882 | + | |
| 2883 | + | |
2883 | 2884 | | |
2884 | | - | |
2885 | 2885 | | |
| 2886 | + | |
| 2887 | + | |
2886 | 2888 | | |
2887 | 2889 | | |
2888 | 2890 | | |
| |||
3075 | 3077 | | |
3076 | 3078 | | |
3077 | 3079 | | |
3078 | | - | |
| 3080 | + | |
3079 | 3081 | | |
3080 | 3082 | | |
3081 | 3083 | | |
3082 | 3084 | | |
3083 | 3085 | | |
| 3086 | + | |
3084 | 3087 | | |
3085 | 3088 | | |
3086 | 3089 | | |
3087 | 3090 | | |
3088 | 3091 | | |
3089 | 3092 | | |
| 3093 | + | |
3090 | 3094 | | |
3091 | 3095 | | |
3092 | 3096 | | |
| |||
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | | - | |
| 31 | + | |
| 32 | + | |
31 | 33 | | |
32 | | - | |
| 34 | + | |
| 35 | + | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
39 | 45 | | |
40 | 46 | | |
41 | 47 | | |
| |||
Lines changed: 22 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
84 | 85 | | |
85 | | - | |
| 86 | + | |
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| |||
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
| 98 | + | |
97 | 99 | | |
98 | 100 | | |
| 101 | + | |
99 | 102 | | |
100 | | - | |
| 103 | + | |
101 | 104 | | |
102 | 105 | | |
103 | 106 | | |
| |||
109 | 112 | | |
110 | 113 | | |
111 | 114 | | |
| 115 | + | |
112 | 116 | | |
113 | 117 | | |
114 | 118 | | |
| |||
259 | 263 | | |
260 | 264 | | |
261 | 265 | | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
262 | 282 | | |
263 | 283 | | |
264 | 284 | | |
| |||
0 commit comments