Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion litellm/proxy/auth/auth_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,15 @@ def is_request_body_safe(
A malicious user can set the api_base to their own domain and invoke POST /chat/completions to intercept and steal the OpenAI API key.
Relevant issue: https://huntr.com/bounties/4001e1a2-7b7a-4776-a3ae-e6692ec3d997
"""
banned_params = ["api_base", "base_url", "user_config"]
banned_params = [
"api_base",
"base_url",
"user_config",
"aws_sts_endpoint",
"aws_web_identity_token",
"aws_role_name",
"vertex_credentials",

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.

High: SSRF via unbanned aws_bedrock_runtime_endpoint

aws_bedrock_runtime_endpoint controls the destination URL for all Bedrock API calls (see base_aws_llm.py:1114-1150). It's functionally equivalent to api_base for Bedrock models. An authenticated user can set this in the request body to redirect the proxy's SigV4-signed request to an attacker-controlled server, leaking the operator's AWS credentials.

Also missing: vertex_ai_credentials (alias for vertex_credentials — see vertex_llm_base.py:748-753).

Suggested change
"vertex_credentials",
"vertex_credentials",
"vertex_ai_credentials",
"aws_bedrock_runtime_endpoint",
]

]
Comment on lines +154 to +162

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.

P2 No new tests for newly banned params

The PR description claims five per-param rejection checks, but no test cases covering aws_sts_endpoint, aws_web_identity_token, aws_role_name, or vertex_credentials appear in tests/proxy_unit_tests/test_proxy_utils.py (the only file that calls is_request_body_safe). The existing 56 passing tests don't exercise the new entries, so a future regression could silently remove these protections undetected.

Comment on lines +154 to +162

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.

P2 Other sensitive AWS credential params not yet banned

aws_access_key_id, aws_secret_access_key, and aws_session_token are accepted by bedrock's credential helper (see litellm/llms/bedrock/common_utils.py lines 257–297) but are absent from banned_params. A client that passes these fields forces the proxy to authenticate to AWS with caller-controlled credentials, potentially bypassing per-model access controls or audit boundaries. The existing escape hatches (allow_client_side_credentials, configurable_clientside_auth_params) already give operators an explicit opt-in path — consider extending the ban to these fields as well for consistency.


for param in banned_params:
if (
Expand Down
Loading