File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -7182,14 +7182,11 @@ def get_secret(
71827182 b64_flag = _is_base64 (encrypted_secret )
71837183 if b64_flag == True : # if passed in as encoded b64 string
71847184 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 :
71917185 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
71937190 response = client .decrypt (
71947191 request = {
71957192 "name" : litellm ._google_kms_resource_name ,
You can’t perform that action at this time.
0 commit comments