litellm/tests/test_litellm/proxy/auth
user 76aa97f77b
fix(proxy): close three variant metadata/tag injection paths
Close three variant bypasses adjacent to VERIA-28 found during post-fix
variant audit:

1. _guardrail_modification_check had the same isinstance(dict) bypass
   Veria-AI just flagged on the pre-call strip. A caller sending
   `{"metadata": "{…}"}` as a JSON-encoded string (multipart/form-data
   or extra_body) skipped the guard, got parsed to dict downstream, and
   reached guardrail logic with bypass flags intact. Coerce strings via
   safe_json_loads before evaluating.

2. The allow_client_tags strip only covered body metadata.tags and
   litellm_metadata.tags — caller-supplied tags arriving via the
   x-litellm-tags header or root-level data["tags"] bypassed it. Gate
   add_request_tag_to_metadata's result on the same flag.

3. requester_metadata was deepcopied BEFORE the strip, so attacker
   injections (user_api_key_metadata shadows, disallowed tags,
   _pipeline_managed_guardrails) persisted in the snapshot. The PANW
   guardrail (and any future consumer) trusting requester_metadata
   would see forged values. Move the deepcopy to after the strip.

Regression tests added for each.
2026-04-16 23:35:26 +00:00
..
test_auth_checks.py fix(proxy): close three variant metadata/tag injection paths 2026-04-16 23:35:26 +00:00
test_auth_exception_handler.py
test_auth_hot_path_network_requests.py fix: update docker test file to right path 2026-02-19 18:44:28 +05:30
test_auth_utils.py fix: guard empty-dict team limits and malformed int in deployment default limits 2026-03-19 07:40:47 -04:00
test_cli_auth.py
test_custom_auth_end_user_budget.py fix(proxy): make common_checks opt-in for custom auth via custom_auth_run_common_checks 2026-03-03 22:50:34 +05:30
test_handle_jwt.py Revert "fix(proxy): set key_alias=user_id in JWT auth for Prometheus metrics …" (#25438) 2026-04-09 11:32:14 -07:00
test_info_routes.py test: add unit tests for /v2/user/info endpoint and route checks 2026-03-12 07:46:31 +00:00
test_litellm_license.py fix: remove leading space from license public_key.pem (#25339) 2026-04-08 21:30:38 -07:00
test_login_utils.py
test_mcp_ip_filtering.py Return Clear error message why no tools are available / IP Filtering occured 2026-02-26 09:56:44 +05:30
test_model_checks_fallbacks.py
test_model_checks.py Reapply "feat: add model_cost aliases expansion support" 2026-03-12 13:36:57 -03:00
test_object_permission_loading.py Fix:test_get_key_object_loads_object_permission 2026-02-18 19:18:15 +05:30
test_onboarding.py fix(onboarding): prevent invite link reuse for password reset 2026-02-28 17:39:03 -08:00
test_organization_budget_enforcement.py
test_password_hashing.py chore: fixes 2026-03-30 18:36:58 -07:00
test_route_checks.py Litellm ishaan april2 (#25113) 2026-04-04 12:31:49 -07:00
test_team_member_budget.py
test_unmapped_model_budget_enforcement.py fix(auth): enforce budget for models not in cost map (#24949) 2026-04-01 19:10:30 -07:00
test_user_api_key_auth.py fix(auth): gate post-custom-auth DB lookups behind opt-in flag (#25634) 2026-04-13 08:02:16 -07:00