16 views
-/https://github.com/berriai/litellm/issues/26399
GitHub · issue

#26399 [Bug]: Bedrock passthrough routes bypass key.models / user.models access control

  • State: open
  • Author: @netblack
  • Labels: llm translation, claude code

## What happened?

The Bedrock passthrough routes under `/bedrock/model/{modelId}/...` **do not enforce** the `models` allowlist configured on the API key (`key.models`) or on the user (`user.models`). A virtual key scoped to a specific set of models can freely call **any** Bedrock model via these routes.

This is particularly impactful for Claude Code CLI users, because Claude Code has a first-class Bedrock integration (`CLAUDE_CODE_USE_BEDROCK=1` + `AWS_BEARER_TOKEN_BEDROCK=<litellm_virtual_key>`) that hits this exact path — so a key intended to grant access to only a limited set of models can be used to call frontier Bedrock models (e.g. `claude-opus-4-7`) without any warning.

## Repro

Tested against a deployment running `v1.83.3-stable.patch.2`. The code path exists unchanged on `main` (HEAD as of this writing).

### Setup

1. Define a model named `claude-opus-4-7` in `config.yaml` pointing at `bedrock/global.anthropic.claude-opus-4-7`. 2. Create a virtual key whose `models` list **does not** include `claude-opus-4-7` (e.g. it only contains an access group that does not cover this model).

### Step 1 — Standard routes correctly block (baseline)

All three standard entrypoints…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (2 events)
#0 of 0 · 31d17h55m12s ago — entered · #import:https:::github.com:berriai:litellm post #2938
The left issue is harder because it requires auditing and integrating authorization consistently across Bedrock passthrough entry points, preserving existing access-group semantics, and adding security-focused regression coverage. The right issue is comparatively localized to dashboard provider metadata, form rendering, and frontend validation.
#0 of 0 · 31d17h45m35s ago — current · #import:https:::github.com:berriai:litellm post #3111
The right issue is harder because it involves tracing and correcting authorization across passthrough routing, preserving existing key/user policy semantics, covering alternate request paths, and adding security-focused regression tests. The left issue is a narrowly scoped configuration and cost-calculation update for a small set of model variants.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search