-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
fix: prevent key-level metadata.tags from leaking into Bedrock passthrough body #30985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mateo-berri
merged 5 commits into
litellm_internal_staging
from
litellm_bedrock_passthrough_metadata_leak
Jun 22, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
fe5164c
fix: prevent key-level metadata.tags from leaking into Bedrock passth…
factnn b98ef2a
test: cover bedrock key-tag litellm_metadata pre-seed in common_checks
mateo-berri 8beba99
refactor(auth): pre-seed litellm_metadata from LITELLM_METADATA_ROUTES
mateo-berri dbd1600
fix(auth): pre-seed litellm_metadata before header-tag merge
cursoragent 6bd0af2
test(auth): guard early litellm_metadata pre-seed wiring for header tags
mateo-berri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not add all pass throughs endpoints here ?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bedrock is the only passthrough that needs to be in LITELLM_METADATA_ROUTES. Every other passthrough goes through create_pass_through_route, which already strips both metadata and litellm_metadata from the forwarded body, so tags never leak there
Only Bedrock uses the body-preserving base_passthrough_process_llm_request path that leaks
Adding them all would also be unsafe, since the /openai substring would catch the native /openai/deployments/.../chat/completions route and wrongly flip its metadata field
They follow different paths because Bedrock uses the heavier allm_passthrough_route path (for SigV4 signing, URL building, router-model resolution, cost tracking) which signs and forwards the body verbatim, no strip