File tree 1 file changed +4
-7
lines changed
1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -7182,14 +7182,11 @@ def get_secret(
7182
7182
b64_flag = _is_base64 (encrypted_secret )
7183
7183
if b64_flag == True : # if passed in as encoded b64 string
7184
7184
encrypted_secret = base64 .b64decode (encrypted_secret )
7185
- if not isinstance (encrypted_secret , bytes ):
7186
- # If it's not, assume it's a string and encode it to bytes
7187
- ciphertext = eval (
7188
- encrypted_secret .encode ()
7189
- ) # assuming encrypted_secret is something like - b'\n$\x00D\xac\xb4/t)07\xe5\xf6..'
7190
- else :
7191
7185
ciphertext = encrypted_secret
7192
-
7186
+ else :
7187
+ raise ValueError (
7188
+ f"Google KMS requires the encrypted secret to be encoded in base64"
7189
+ )#fix for this vulnerability https://huntr.com/bounties/ae623c2f-b64b-4245-9ed4-f13a0a5824ce
7193
7190
response = client .decrypt (
7194
7191
request = {
7195
7192
"name" : litellm ._google_kms_resource_name ,
You can’t perform that action at this time.
0 commit comments