Skip to content

fix(proxy): backport #34266 to stable/1.93.x for ad hoc release - #34372

Closed
mateo-berri wants to merge 1 commit into
stable/1.93.xfrom
litellm_cherrypick_v1_93_0_adhoc
Closed

mateo-berri wants to merge 1 commit into
stable/1.93.xfrom
litellm_cherrypick_v1_93_0_adhoc

Conversation

@mateo-berri

Copy link
Copy Markdown
Contributor

Ad hoc release branch: identical to v1.93.0 plus one fix.

Included

Notes

Mirror of #34266 onto stable/1.93.x (v1.93.0) for an ad hoc release.
Applied from PR head 098cb5d (upstream PR still open against litellm_internal_staging).
@mateo-berri
mateo-berri marked this pull request as ready for review July 23, 2026 06:46
@mateo-berri
mateo-berri requested a review from a team July 23, 2026 06:46
@greptile-apps

greptile-apps Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This backport changes team-cache refresh behavior to prevent stale allowlists after team updates

  • Invalidates the internal usage cache before writing refreshed team state
  • Stops authentication from writing fallback or cache-derived team objects back to the canonical cache
  • Adds regression coverage for shared Redis topology and invalidation failures

Confidence Score: 3/5

The alias-cache invalidations should be made independent before merging so one cache backend failure cannot leave outdated team permissions active

A synchronous Redis deletion failure is caught, but because both invalidations share the same try block it prevents cleanup of the separate internal cache that alias authentication reads first

litellm/proxy/auth/auth_checks.py

Security Review

The alias invalidation path can still retain outdated authorization state when its first cache deletion fails, because that failure skips deletion from the independently owned internal usage cache

Important Files Changed

Filename Overview
litellm/proxy/auth/auth_checks.py Adds internal team-cache invalidation, but couples two alias-cache deletions so one backend failure can leave stale authorization state
litellm/proxy/auth/user_api_key_auth.py Removes a redundant and potentially stale team-object writeback from the authentication path
tests/test_litellm/proxy/auth/test_auth_checks.py Adds regression coverage for cache ordering and backend failures, but does not cover partial failure between the two alias-cache invalidations
tests/test_litellm/proxy/auth/test_user_api_key_auth.py Verifies that authentication fallback objects are not persisted into the canonical team cache
tests/test_litellm/proxy/management_endpoints/test_team_endpoints.py Updates the team endpoint test fixture for the newly invoked internal-cache invalidation

Reviews (1): Last reviewed commit: "fix(proxy): stop serving stale team mode..." | Re-trigger Greptile

Comment on lines +1784 to +1787
try:
user_api_key_cache.delete_cache(key=alias_key)
if proxy_logging_obj is not None:
await proxy_logging_obj.internal_usage_cache.dual_cache.async_delete_cache(key=alias_key)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 security Alias invalidation stops early

When the synchronous Redis deletion from user_api_key_cache fails during a team update, the shared exception handler skips deletion from the independently owned internal usage cache, causing alias-authenticated requests to continue using outdated team model permissions until that entry expires

Rule Used: What: Fail any PR which may contains a security in... (source)

Knowledge Base Used:

@devin-ai-integration

Copy link
Copy Markdown
Contributor

🚅 Hi, thanks for the PR! I'm Agent Shin, the automated triage bot for this repository. What's this and why am I getting it?

I read the description against our contribution rubric. Here's how it lined up:

What you got right:

  • ✅ Linked a related GitHub issue
  • ✅ Clear problem description

What's still missing:

  • expected vs actual behavior or a clear feature/bug description beyond the title
  • end-to-end QA proof (video, screenshot, or real commands with output)

The PR links a related issue and describes the backport, but it does not state the bug’s expected vs actual behavior in the body. It also only mentions unit test results, which are not end-to-end QA proof under the triage rules.

If the description isn't updated in the next 24 hours, I'll auto-close this PR. That's not us saying we don't care about the change; we want the open-PR list to mirror what a maintainer can act on right now, so contributors don't get lost in a backlog. A closed PR is a soft "park this for later," not a rejection. Take your time; everything below still works after the close.

During the grace period: just update the PR description with the missing pieces. No need to ping me; I'll re-check on the next sweep and skip the auto-close if it now passes. See what counts as QA proof for the full rubric (a linked issue alone isn't enough; it covers context, not proof).

If the PR does get auto-closed in 24 hours, you still have easy recovery paths:

  • Comment @agent-shin reconsider after updating the description. I'll re-evaluate and reopen the PR if it now passes.
  • Comment @greptileai to request a fresh Greptile review; that still works even after the PR is closed, and a stronger score is one of the signals that lifts the PR back into the queue. So a low Greptile score isn't a blocker either.

Internal BerriAI contributors: this rubric doesn't apply to you; ping a maintainer.

(I'm an LLM, so I'm not infallible. If you think I got this wrong, ping a maintainer; they'll override me.)

@mateo-berri

Copy link
Copy Markdown
Contributor Author

Closing as abandoned since it has had no commits or human comments in over 30 days. Reopen it if it is still needed

@mateo-berri mateo-berri closed this Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant