mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-27 01:22:18 +00:00
fix(jwt): strip internal _litellm_* claims in global JWKS auth path
Prevents identity spoofing where a token signed by the global JWKS could inject _litellm_jwt_issuer and other _litellm_* claims that downstream getters trust. The issuer-scoped path already strips these via _apply_issuer_claim_mappings; mirror that behavior for the global fallback path. Co-authored-by: Yassin Kortam <yassin@berri.ai>
This commit is contained in:
parent
6f82537c35
commit
5d8f74f1c1
1 changed files with 5 additions and 1 deletions
|
|
@ -1064,7 +1064,11 @@ class JWTHandler:
|
|||
issuer=decode_kwargs["issuer"],
|
||||
options=decode_kwargs["options"],
|
||||
)
|
||||
return payload
|
||||
return {
|
||||
k: v
|
||||
for k, v in payload.items()
|
||||
if k not in self.LITELLM_INTERNAL_CLAIMS
|
||||
}
|
||||
|
||||
except jwt.ExpiredSignatureError:
|
||||
# the token is expired, do something to refresh it
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue