From daf620353d64b2d7adb6525e05d43b2a9c3adb52 Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Sat, 31 Oct 2026 19:07:49 -0700 Subject: [PATCH] fix(ui): guard i18n label lookups against prototype-named values A server value such as "toString" used as a key into a label map resolved to an Object.prototype member and was passed to t(), which throws. Check own properties before translating so those values fall back to the raw string as before --- .../cache_settings/RedisTypeSelector.tsx | 9 +++++++-- .../CoordinationRedisTypeSelector.tsx | 6 +++++- .../coordinationRedisUtils.ts | 2 +- .../Settings/AdminSettings/CyberArk/CyberArk.tsx | 12 +++++++----- .../AdminSettings/CyberArk/EditCyberArkModal.tsx | 2 +- .../HashicorpVault/EditHashicorpVaultModal.tsx | 2 +- .../HashicorpVault/HashicorpVault.tsx | 12 +++++++----- .../SSOSettings/Modals/BaseSSOSettingsForm.tsx | 6 ++++-- .../AdminSettings/SSOSettings/RoleMappings.tsx | 14 ++++++++++++-- .../AdminSettings/SSOSettings/SSOSettings.tsx | 2 +- .../LoggingCallbacksTableColumns.tsx | 2 +- .../src/components/routing_groups/strategy.ts | 2 +- 12 files changed, 48 insertions(+), 23 deletions(-) diff --git a/ui/litellm-dashboard/src/app/(dashboard)/caching/_components/cache_settings/RedisTypeSelector.tsx b/ui/litellm-dashboard/src/app/(dashboard)/caching/_components/cache_settings/RedisTypeSelector.tsx index db8d0cd8b84..d88d9390bf5 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/caching/_components/cache_settings/RedisTypeSelector.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/caching/_components/cache_settings/RedisTypeSelector.tsx @@ -23,7 +23,9 @@ const RedisTypeSelector: React.FC = ({ redisType, redisT

- {t(redisTypeDescriptions[redisType] || "caching.settings.redisType.fallbackDescription")} + {t( + (Object.hasOwn(redisTypeDescriptions, redisType) && redisTypeDescriptions[redisType]) || + "caching.settings.redisType.fallbackDescription", + )}

); diff --git a/ui/litellm-dashboard/src/app/(dashboard)/caching/_components/coordination_redis_settings/CoordinationRedisTypeSelector.tsx b/ui/litellm-dashboard/src/app/(dashboard)/caching/_components/coordination_redis_settings/CoordinationRedisTypeSelector.tsx index 39e5ee89778..9dd2c6b24d7 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/caching/_components/coordination_redis_settings/CoordinationRedisTypeSelector.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/caching/_components/coordination_redis_settings/CoordinationRedisTypeSelector.tsx @@ -22,7 +22,11 @@ const CoordinationRedisTypeSelector: React.FC