litellm/tests/test_litellm/proxy
yucheng-berriai 7d9ac8d043 fix(security): reject path traversal and control chars in key_alias-derived secret names (LIT-4201)
key_alias becomes the secret name written to HashiCorp Vault and CyberArk
Conjur when store_virtual_keys is enabled. Vault's get_url concatenated
secret_name directly into the request URL and Conjur's
_ensure_variable_exists interpolated it unescaped into a YAML policy body,
so a malicious key_alias could path-traverse the Vault write or inject
extra Conjur policy statements. The only existing guard was opt-in
(enable_key_alias_format_validation, default off) and its charset still
permitted ".." even when enabled.

Add raise_if_unsafe_secret_name, an unconditional check rejecting ".."
sequences and control characters (including the Unicode line breaks YAML
treats the same as "\n": NEL, LINE SEPARATOR, PARAGRAPH SEPARATOR), applied
at both vulnerable sinks and at the API boundary in
_validate_key_alias_format, independent of the opt-in flag.

Also close two adjacent gaps found in internal review: Vault's get_url now
percent-encodes secret_name (preserving "/" and "@") so "#"/"?" can't turn
into a URL fragment/query string instead of a literal path segment, and
Conjur's policy YAML is now built with a real YAML serializer
(yaml.safe_dump forced to double-quoted style) instead of raw string
interpolation, so metacharacters that aren't on the traversal/control-char
denylist (a bare ":" or "#") can no longer change the parsed policy
structure.
2026-07-03 18:19:44 -07:00
..
_experimental/mcp_server feat(mcp): make token_exchange (OBO) production-ready - discovery threading + audit hardening + RFC 9728 challenge (#31622) 2026-07-03 17:12:25 -07:00
a2a feat(a2a): support a2a-sdk 1.x proxy routing for 0.3 and 1.0 agents (#30950) 2026-06-29 09:32:39 +05:30
agent_endpoints feat(a2a): support a2a-sdk 1.x proxy routing for 0.3 and 1.0 agents (#30950) 2026-06-29 09:32:39 +05:30
anthropic_endpoints feat: litellm oss staging (#31935) 2026-07-03 09:27:31 +05:30
auth feat(proxy): add key-level budget_fallbacks to reroute requests when a per-model budget is exceeded (#31783) 2026-07-03 12:20:12 -07:00
batches_endpoints test(batches): add 1:1 test file scaffold for batches component paths (#30529) 2026-06-29 09:22:58 +05:30
client feat(proxy): add AES-256-GCM at-rest credential encryption with versioned format and re-encryption migration (#31215) 2026-06-29 20:14:22 +02:00
common_utils feat(proxy): add AES-256-GCM at-rest credential encryption with versioned format and re-encryption migration (#31215) 2026-06-29 20:14:22 +02:00
db fix(proxy): isolate poison spend-log rows so one bad record can't drop the whole batch (#31705) 2026-06-30 12:21:14 -07:00
discovery_endpoints
experimental/mcp_server
google_endpoints
guardrails fix(guardrails): address review comments on headroom fail_open 2026-07-03 19:40:33 +00:00
health_endpoints fix(proxy): authorize /health/test_connection against loaded deployment's team_id (VERIA-441) (#31767) 2026-07-01 17:05:49 -07:00
hooks fix(mcp): roll up MCP tool spend to user counters and usage UI (#31576) 2026-07-02 08:16:39 -07:00
image_endpoints
logging_endpoints feat(proxy): add POST /v1/callbacks/logs to replay logging payloads through callbacks (#31134) 2026-06-24 15:25:10 -07:00
management_endpoints fix(security): reject path traversal and control chars in key_alias-derived secret names (LIT-4201) 2026-07-03 18:19:44 -07:00
management_helpers feat(mcp): add all-proxy-mcpservers sentinel to grant teams every MCP server (#32012) 2026-07-03 13:59:28 -07:00
memory
middleware
openai_files_endpoint fix(vertex/files): stream OpenAI->Vertex batch JSONL uploads (#31036) 2026-06-24 13:19:57 -07:00
pass_through_endpoints test(e2e): add live batches suite across providers and routing scenarios (#30958) 2026-07-02 08:05:23 -07:00
policy_engine fix(guardrails): match policy-pipeline block response to direct guardrail attachment (#31421) 2026-06-26 14:25:10 -07:00
prompts
proxy_server fix(proxy): tighten role gating on /get/config/callbacks response (#31745) 2026-07-01 17:58:31 -07:00
public_endpoints feat(ui): add Amazon Bedrock Mantle to the Add Model provider dropdown (#31034) 2026-06-22 17:31:25 -07:00
rag_endpoints
realtime_endpoints
response_api_endpoints
shutdown
spend_tracking fix(mcp): roll up MCP tool spend to user counters and usage UI (#31576) 2026-07-02 08:16:39 -07:00
test_configs
types_utils
ui_crud_endpoints fix(mcp): byom visibility, preview UX, and admin settings gating (#31809) 2026-07-02 01:04:22 -07:00
utils fix(proxy): isolate poison spend-log rows so one bad record can't drop the whole batch (#31705) 2026-06-30 12:21:14 -07:00
vector_store_endpoints
video_endpoints test(videos): add 1:1 test file scaffold for videos component paths (#30631) 2026-06-29 09:12:51 +05:30
__init__.py
conftest.py
test_aiohttp_cleanup_closed.py
test_aiohttp_session_recovery.py
test_api_key_masking_in_errors.py
test_audio_speech_prometheus_hooks.py
test_batch_expiry.py
test_batch_metadata_none_fix.py
test_batch_retrieve_bedrock.py
test_batch_x_litellm_model_encoding.py
test_blocked_response_usage.py feat: litellm oss staging (#31935) 2026-07-03 09:27:31 +05:30
test_budget_reservation.py
test_caching_routes.py
test_chat_completion_metadata.py
test_common_request_processing.py fix(proxy): emit x-litellm-response-cost header on /messages and /generateContent (LIT-4076) (#31675) 2026-06-29 20:29:49 -07:00
test_component_allowlists.py
test_cors_config.py
test_custom_proxy.py
test_dynamic_mcp_route.py
test_empty_model_list.py
test_enforce_user_param.py
test_fallback_management_endpoints.py
test_fastapi_offline_routes.py
test_filter_models_by_team_access_group.py
test_health_check_functions.py
test_health_check_max_tokens.py fix: skip health check for semantic auto_router deployments (#31668) 2026-06-29 19:47:20 -07:00
test_langfuse_passthrough_security.py
test_lazy_openapi_snapshot.py
test_litellm_pre_call_utils.py fix(proxy): restore admin key/team callback_vars.turn_off_message_logging override (LIT-3587) (#31905) 2026-07-02 15:01:58 -07:00
test_max_budget_env_var.py
test_mcp_asgi_response.py
test_model_based_routing_files_batches.py
test_model_dump_with_preserved_fields.py
test_model_id_header_propagation.py
test_model_info_default_limits.py
test_model_level_guardrails.py
test_model_list_healthy_only.py
test_modify_response_streaming_passthrough.py
test_openapi_schema_validation.py
test_plugin_routes.py feat: litellm plugin architecture v2 (#30688) 2026-06-20 20:37:22 -07:00
test_pricing_field_strip.py
test_prometheus_cleanup.py
test_provider_url_destination_guard.py
test_proxy_cli.py chore: litellm oss staging (#30968) 2026-06-23 07:31:44 -07:00
test_proxy_logging_hook_detection.py
test_proxy_server.py fix(proxy): tighten role gating on /get/config/callbacks response (#31745) 2026-07-01 17:58:31 -07:00
test_proxy_types.py
test_proxy_utils.py fix(proxy): record partial spend on the failure row for interrupted streams (#30788) 2026-06-19 12:03:15 -07:00
test_pyroscope.py
test_read_model_list.py feat: add minimal rust router + axum ai-gateway calling router.realtime (2/2) (#31135) 2026-06-23 19:16:34 -07:00
test_redis_auth_cache_flag.py
test_response_model_sanitization.py
test_route_a2a_models.py
test_route_llm_request.py
test_sensitive_route_auth.py
test_shared_health_check.py
test_spend_log_cleanup.py
test_swagger_chat_completions.py
test_team_member_update.py
test_team_org_move.py
test_tools_allowlist_enforcement.py
test_update_llm_router_resilience.py