From 4145f8c09896e3033188acb3eef83c612c0ebe55 Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Sat, 25 Oct 2025 15:47:26 -0700 Subject: [PATCH] fix: regression responses_id_security --- litellm/proxy/hooks/responses_id_security.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/litellm/proxy/hooks/responses_id_security.py b/litellm/proxy/hooks/responses_id_security.py index cfc2e10f40b..15b2c1f4f2e 100644 --- a/litellm/proxy/hooks/responses_id_security.py +++ b/litellm/proxy/hooks/responses_id_security.py @@ -133,8 +133,11 @@ class ResponsesIDSecurity(CustomLogger): return True def _is_encrypted_response_id(self, response_id: str) -> bool: - - remaining_string = response_id.split("resp_")[1] + split_result = response_id.split("resp_") + if len(split_result) < 2: + return False + + remaining_string = split_result[1] decrypted_value = decrypt_value_helper( value=remaining_string, key="response_id", return_original_value=True ) @@ -155,7 +158,11 @@ class ResponsesIDSecurity(CustomLogger): - user_id: the user id - team_id: the team id """ - remaining_string = response_id.split("resp_")[1] + split_result = response_id.split("resp_") + if len(split_result) < 2: + return response_id, None, None + + remaining_string = split_result[1] decrypted_value = decrypt_value_helper( value=remaining_string, key="response_id", return_original_value=True )