From 2ea3fafb68e1424673ea5eaf452016d2a2f8f0e5 Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Thu, 16 Apr 2026 16:01:07 -0700 Subject: [PATCH] fix: tighten api_key value check in credential validation --- litellm/proxy/auth/auth_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/litellm/proxy/auth/auth_utils.py b/litellm/proxy/auth/auth_utils.py index 64766bbaad..33f4134865 100644 --- a/litellm/proxy/auth/auth_utils.py +++ b/litellm/proxy/auth/auth_utils.py @@ -69,7 +69,8 @@ def check_complete_credentials(request_body: dict) -> bool: # complex credentials - easier to make a malicious request return False - if "api_key" in request_body: + api_key_value = request_body.get("api_key") + if api_key_value and isinstance(api_key_value, str) and api_key_value.strip(): return True return False