Skip to content

chore(deps): bump vulnerable dependencies - #26365

Merged
yuneng-berri merged 32 commits into
BerriAI:litellm_yj_apr23from
stuxf:fix/deps-security-bumps
Apr 24, 2026
Merged

chore(deps): bump vulnerable dependencies#26365
yuneng-berri merged 32 commits into
BerriAI:litellm_yj_apr23from
stuxf:fix/deps-security-bumps

Conversation

@stuxf

@stuxf stuxf commented Apr 23, 2026

Copy link
Copy Markdown
Collaborator

Relevant issues

Closes open Dependabot alerts against uv.lock and the runtime-stage npm pins in Dockerfile.

Pre-Submission checklist

  • I have Added testing in the tests/test_litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem
  • I have requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

Type

🚄 Infrastructure

Changes

Python (pyproject.toml):

  • pypdf 6.7.5 → 6.10.2
  • llm-sandbox 0.3.31 → 0.3.39
  • Pillow 12.1.1 → 12.2.0
  • orjson 3.11.5 → 3.11.6
  • PyJWT 2.11.0 → 2.12.0
  • aiohttp 3.13.3 → 3.13.4
  • python-dotenv 1.0.1 → 1.2.2
  • mlflow 3.9.0 → 3.11.1
  • black 24.10.0 → 26.3.1
  • pytest 8.3.5 → 9.0.3
  • pytest-asyncio 1.2.0 → 1.3.0

Runtime-stage npm pins (Dockerfile):

  • glob 11.1.0 → 13.0.6
  • @isaacs/brace-expansion 5.0.1 → 5.0.5
  • picomatch 4.0.4 pinned (new)

The six per-package find … | while read override stanzas in the runtime stage are collapsed into a single loop over the pinned package list.

ryan-crabbe-berri and others added 21 commits April 22, 2026 15:00
Adds a "Total Spend (USD)" column backed by the new
membership.total_spend field. Cumulative across budget cycles;
tracking began 2026-04-21.
Adds a formatBudgetReset helper (dayjs-based, with validity guard) that
renders the next reset as "today" / "in N days" / "on MMM D, YYYY". The
team budget card now shows the team's reset timestamp and the member-
default reset (when a shared team_member_budget is configured), and the
Members tab gains a Budget Reset column per member.
Adds back the per-cycle spend column that was replaced by Total Spend in
331e3f2. Current Cycle Spend reads membership.spend (zeroed on
budget_reset_at) — this is the value enforced against the member's
budget, so admins need it to see whether a member is approaching their
cap for the active window. Total Spend remains for lifetime analytics.
…dgets

Two independent bugs both masked budget_reset_at from consumers that
needed it:

1. /team/info.team_member_budget_table was typed as LiteLLM_BudgetTable
   (the user-settable allowlist), which dropped server-managed fields.
   Switched to LiteLLM_BudgetTableFull so budget_reset_at and created_at
   are serialized.

2. _clone_team_default_budget_for_member copied the pool's numeric
   fields but never set budget_reset_at on the cloned row. With
   budget_duration present but no reset timestamp, the reset job never
   fires on the member's budget (its query is reset_at <= now, which
   never matches NULL). Now computes budget_reset_at from the cloned
   budget_duration via get_budget_reset_time so each member's cycle
   starts at clone time rather than inheriting the pool's stale reset.
[Infra] Promote interal staging to main
The periodic budget-window reset job filtered keys/teams with
`where={"budget_limits": {"not": None}}`. The prisma-client-python
library does not support null-filtering on `Json?` columns (no
DbNull/JsonNull sentinel — upstream issue #714). The client drops the
`None` value during serialization and the engine rejects the query with
`MissingRequiredValueError: where.budget_limits.not: A value is
required but not set`, so neither the key nor team reset path runs.

Switch those two `find_many` calls to `query_raw` with
`WHERE budget_limits IS NOT NULL`, selecting only the PK and the
`budget_limits` column. Writes still go through the ORM. Add unit tests
covering the expired/unexpired paths for keys and teams, string-encoded
JSON payloads, empty payloads, error isolation between the two paths,
and a regression guard asserting the query still uses `IS NOT NULL`.
Two independent deflakes:

1. test_ui_view_spend_logs_unauthorized (unit) was returning 400 instead
   of 401/403 when earlier tests in the file left proxy-auth globals
   (prisma_client, master_key, user_custom_auth, general_settings,
   user_api_key_cache) in a state that let invalid tokens pass auth and
   fall through to the endpoint's own start_date/end_date validation.
   Add an autouse fixture that pins those globals to their import-time
   defaults for every test in the file. Harden the assertion to include
   response body so future flakes are diagnosable.

2. test_basic_spend_accuracy (CI job proxy_spend_accuracy_tests) depends
   on the Redis transaction buffer flushing spend to Postgres. The buffer
   uses a single global pod-lock key (cronjob_lock:db_spend_update_job)
   and a single global buffer list key. Pointing the proxy at the shared
   remote Redis means concurrent CI pipelines contend for the same lock
   and can drain each other's buffer into the wrong database. Add a
   start_redis reusable command that boots a per-job redis:7-alpine
   container (digest-pinned), and switch proxy_spend_accuracy_tests to
   REDIS_HOST=host.docker.internal:6379 so lock and buffer state are
   isolated per CI run.
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Previous commit from greptile-apps added a new `when: always` teardown
step without removing the prior `name:`-only step, leaving a `- run`
block with no `command:` — CircleCI config validation rejects that.
Collapse back to a single teardown step that runs on success and
failure.
The mocked async_increment_cache_pipeline is invoked from Router's
deployment_callback_on_success, registered as an async success callback.
Those callbacks are enqueued to GLOBAL_LOGGING_WORKER and run on a
background task, so the mock may not have been called yet when the test
asserts on it. Flush the worker before asserting.
The previous `while not self._queue.empty(): await self._queue.join()`
pattern skipped the join entirely when the worker had already dequeued a
task but not yet called task_done(). asyncio.Queue.join() tracks
_unfinished_tasks (incremented by put, decremented by task_done), not
queue depth, so it already handles that case on its own.
The create-branch job in create-release.yml calls the reusable
create-release-branch.yml workflow, which requires contents: write.
The top-level permissions: {} blocks the inherited default, and only
the release job overrode it, so the nested call failed with:

  The nested job 'create-branch' is requesting 'contents: write',
  but is only allowed 'contents: none'.

Add the permission at the calling job level so the reusable
workflow is granted what it needs.
[Fix] Tests - drain logging worker in test_router_caching_ttl to fix flakiness
Relative labels ("today", "in 2 days", "on May 12, 2026") mixed three
shapes in one column, breaking scannability. Always render MMM D, YYYY
for consistency and easier at-a-glance comparison across members.
…ion locations (#26281)

Vertex multi-region endpoints (e.g. us, eu) use the rep host pattern, not
{geo}-aiplatform.googleapis.com. Regional IDs still contain a hyphen.

common_utils.get_vertex_base_url centralizes the rule for SDK/API URL building.
Proxy pass-through duplicates the same branching in a local get_vertex_base_url
(with trailing slashes) to avoid importing from common_utils there; live
WebSocket passthrough uses the same multi-region host logic for wss://.

Tests cover us/eu for the common_utils helper.

Made-with: Cursor
[Fix] Infra: grant contents:write to create-release-branch caller job
…is (#26162) (#26318)

Temporary MCP OAuth sessions were kept in process-local memory, so on
multi-instance/LB proxy deployments a session created on instance A could
not be found when the follow-up /server/oauth/{server_id}/... request
landed on instance B.

Persist temporary session records to Redis (encrypted with the existing
proxy encryption helpers) as a best-effort L2 cache alongside the current
in-memory L1. Convert get_cached_temporary_mcp_server to async and await
it from the authorize/token/register OAuth endpoints.

Made-with: Cursor
[Fix] Reset budget windows failing due to Prisma Json? null filter
@veria-ai

veria-ai Bot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Low: Dependency version bumps and Docker image updates

This PR bumps dependencies (aiohttp, python-dotenv, orjson, PyJWT, Pillow, etc.), updates base Docker images and uv tool versions with pinned sha256 digests, and refactors the npm package override loop in the Dockerfile. No security issues found.


Status: 0 open
Risk: 1/10

Posted by Veria AI · 2026-04-24T00:38:33.380Z

@greptile-apps

greptile-apps Bot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR bumps vulnerable Python and npm dependencies, updates base image digests across all Dockerfiles, upgrades the UV tool image from 0.10.9 to 0.11.7, and refactors the npm override loop in the main Dockerfile into a single consolidated for loop.

  • docker/Dockerfile.database was not updated with the new npm package versions — it still installs glob@11.1.0 and @isaacs/brace-expansion@5.0.1, leaving the Dependabot alerts open for images built from this Dockerfile.
  • Dockerfile (main): @isaacs/brace-expansion remains at 5.0.1 despite the PR description stating it is bumped to 5.0.5; the unscoped brace-expansion@5.0.5 (a distinct npm package) was added instead, which may not resolve the alert against the scoped package.

Confidence Score: 3/5

Not safe to merge — two Dockerfiles still ship the vulnerable npm packages this PR is intended to fix.

Two confirmed P1 issues: Dockerfile.database was not updated and still installs glob@11.1.0/@isaacs/brace-expansion@5.0.1, and the main Dockerfile carries @isaacs/brace-expansion@5.0.1 unchanged despite the stated goal.

docker/Dockerfile.database (missing all npm security updates) and Dockerfile (line 72, @isaacs/brace-expansion still at 5.0.1)

Important Files Changed

Filename Overview
Dockerfile Updates base image digests, UV version, and glob to 13.0.6; refactors override loop; but @isaacs/brace-expansion remains at the vulnerable 5.0.1
docker/Dockerfile.database Only removes the sed -i stanza; npm install line still uses glob@11.1.0 and @isaacs/brace-expansion@5.0.1, leaving vulnerable packages and missing the consolidated override loop from the main Dockerfile
pyproject.toml Bumps python-dotenv, aiohttp, orjson, PyJWT, mlflow, pypdf, llm-sandbox, Pillow, black (24→26), pytest (8→9), pytest-asyncio; major-version jumps on dev tools worth CI validation
enterprise/pyproject.toml Relaxes required-version from ==0.10.9 to >=0.10.9 to allow newer uv versions
litellm-proxy-extras/pyproject.toml Same required-version relaxation as enterprise/pyproject.toml; no other changes

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[npm install global packages] --> B{Dockerfile variant}
    B -->|main Dockerfile| C["glob@13.0.6 ✅\n@isaacs/brace-expansion@5.0.1 ⚠️\nbrace-expansion@5.0.5 ✅\npicomatch@4.0.4 ✅"]
    B -->|Dockerfile.database| D["glob@11.1.0 ❌\n@isaacs/brace-expansion@5.0.1 ❌\nno picomatch ❌"]
    B -->|Dockerfile.alpine / .dev / .health_check / .non_root| E["No npm pins\nUV image updated ✅"]
    C --> F[Consolidated for-loop override]
    D --> G[Old per-package find loops - sed stanza only removed]
    F --> H[npm cache clean]
    G --> I[npm cache clean - vulnerable packages remain]
Loading

Comments Outside Diff (1)

  1. docker/Dockerfile.database, line 70-86 (link)

    P1 Vulnerable npm packages not updated

    Dockerfile.database still installs glob@11.1.0 and @isaacs/brace-expansion@5.0.1 — the exact vulnerable versions this PR is supposed to remediate. Unlike the main Dockerfile, which was refactored to use glob@13.0.6, brace-expansion@5.0.5, and picomatch@4.0.4, this file only had its sed -i stanza removed. The consolidated override loop was never added, so images built from this Dockerfile remain affected by the Dependabot alerts.

Reviews (5): Last reviewed commit: "chore(deps): fix brace-expansion pin and..." | Re-trigger Greptile

Comment thread Dockerfile Outdated
Comment thread pyproject.toml Outdated
ryan-crabbe-berri and others added 5 commits April 23, 2026 16:47
Out of scope for the members-tab feature and regressed legacy teams
whose budget_reset_at is null (duration was previously shown as a
fallback).
Members tab column reads this field; dropping it from the type in the
previous revert broke the type check without affecting the reverted
render logic.
…d_frontend

Surface per-member budget cycle in Teams > Members tab
Comment thread pyproject.toml
yuneng-berri and others added 5 commits April 23, 2026 17:30
[Infra] Bump version 1.83.12 → 1.83.13
Closes Nexus IQ policy violations and open Dependabot alerts for
shipped Python deps and runtime-stage npm pins in the Docker image.
Chainguard rebuilds wolfi-base nightly with picked-up security patches.
The current pin is from 2026-04-01; this moves to the latest digest as
of 2026-04-24 to pick up ~3 weeks of accumulated OS package updates
(openssl, glibc, nodejs apk, etc.).
- UV_IMAGE across all Dockerfiles: 0.10.9 -> 0.11.7.
- Loosen `required-version` in enterprise/ and litellm-proxy-extras/
  from strict `==0.10.9` to `>=0.10.9` so the new Docker image can
  build those workspace members. Matches the main pyproject range.
- Drop the `sed` block that rewrote tar/minimatch version ranges in
  npm's bundled package.json files. The override loop above already
  swaps the vendored directories on disk; npm doesn't re-resolve at
  runtime, so the sed was cosmetic.
- Dockerfile: pin the unscoped `brace-expansion@5.0.5` alongside
  `@isaacs/brace-expansion@5.0.1`. The scoped package only has 5.0.0
  and 5.0.1 published; CVE-2026-33750's fix (5.0.5) is on the unscoped
  package which npm also vendors. The override loop now swaps both.
- Revert `black` 26.3.1 -> 24.10.0, `pytest` 9.0.3 -> 8.3.5, and
  `pytest-asyncio` 1.3.0 -> 1.2.0. The major-version bumps cause CI
  lint (black reformats hundreds of files) and code-quality
  (liccheck.ini has no entry for the new versions) failures. Both
  CVEs are dev-only; skipping leaves no runtime exposure.
@yuneng-berri
yuneng-berri changed the base branch from litellm_internal_staging to litellm_yj_apr23 April 24, 2026 20:02
@yuneng-berri
yuneng-berri merged commit 1a3db6d into BerriAI:litellm_yj_apr23 Apr 24, 2026
44 checks passed
fzowl pushed a commit to fzowl/litellm that referenced this pull request Jun 24, 2026
chore(deps): bump vulnerable dependencies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants