Skip to content

EN-132: update the SDK proxy and vulnerable Python dependencies - #1196

Merged
bingran-you merged 6 commits into
mainfrom
ben3-132-security-review
Oct 29, 2026
Merged

bingran-you merged 6 commits into
mainfrom
ben3-132-security-review

Conversation

@xdotli

@xdotli xdotli commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

The SDK's pinned proxy is affected by the authenticated admin-escalation/RCE advisory GHSA-7hp6-4w63-5g45, and its lock contains vulnerable TLS, HTTP and environment-creation dependencies. Pin the proxy to LiteLLM 1.103.3 and update the affected packages while preserving the provider behavior needed for scoring and trajectory capture.

This PR incorporates both commits from #1166 with their authorship/history, retaining the Bedrock adaptive-thinking gate/preflight and Google AI Studio logging compatibility fixes. A bare dependency bump would break those paths. The original contributor's fork is untouched; this organization branch provides one reviewable candidate including the security updates.

Changes:

  • Add certifi >=2026.10.19, aiohttp >=3.14.4 and cryptography >=50 floors to package metadata. Independently installed sandbox proxy environments use the reviewed exact certifi 2026.10.23, aiohttp 3.14.5 and cryptography 50.0.2 releases.
  • Pin virtualenv ==21.14.13 in the fallback environment bootstrap; 21.14.9 introduces a later-disclosed prompt-injection regression.
  • Targeted lock updates: certifi 2026.10.23, aiohttp 3.14.5, virtualenv 21.14.13, filelock 4.2.1, setuptools 84.1.0 and OpenTelemetry 1.45.1 with its required family dependencies. Other lock changes are required by these updates and LiteLLM 1.103.3.

Validation:

  • Fresh Python 3.12 installation from wheels; the local editable project alone is built from reviewed repository source.
  • uv lock --check, uv pip check, ruff check ., ty check src/ and changed-file formatting all pass.
  • Every one of the 252 locked PyPI packages, with platform markers removed, audited against OSV: no known vulnerabilities. The LiteLLM upstream advisory above was checked separately because OSV did not return it.
  • The locked LiteLLM macOS arm64 wheel hash matches PyPI, is not yanked, and has no .pth, sitecustomize.py or usercustomize.py startup hooks.
  • A disposable virtualenv whose path contains literal shell substitution and spaces can run its generated pip launcher without executing the substitution. The affected emSign root is absent from certifi's loaded CA store.
  • Full local unit suite: 6626 passed, 75 skipped, 11 deselected, with one cold-cache uv run subprocess timeout. That same judge fail-closed case passes in 4.06 seconds with the shared package-artifact cache and the same scrubbed HOME/environment, without bypassing synchronization. No production credentials are supplied; the bundled LiteLLM cost map is used.
  • The actual sandbox uv bootstrap also succeeds in a fresh isolated environment with reviewed-lock transitive constraints and source builds disabled, yielding exactly LiteLLM 1.103.3, certifi 2026.10.23, aiohttp 3.14.5 and cryptography 50.0.2.
  • CI Linux unit tests (6684 passed, 18 skipped, 11 deselected), audit, fixture scenarios and rollout smoke checks pass on the final code commit. Marking this PR ready retriggers fixture/smoke checks on the same commit.

The non-required external agents-manifest parity check fails only on OpenClaw install_cmd: agents main installs its canonical prompt helper plus threaded/effort-aware shim, whereas SDK core embeds an older monolithic shim. The remaining config fields and version pins match. Resolving that drift requires a separately reviewed OpenClaw adapter adoption; branch protection does not require this check.

Compatibility and rollout: LiteLLM releases after 1.91 use native wheels. Linux hosts need glibc >=2.28 or a compatible musl wheel; older hosts require an image update or source-build toolchain. Merge/review this candidate, then publish through the existing release process and rebuild/reinstall consumers and sandbox images. Existing exact-version consumers do not acquire these changes automatically. No SDK release, running job, service or deployed environment is changed by this PR.

Linear: EN-132. Dependency work is also tracked under EN-133.

Remaining bootstrap reproducibility gap: boto3, dynamically requested provider packages and their transitive dependencies still resolve independently of uv.lock; the fallback pip upgrade and the existing uv installer are also unpinned. The current installer has no hash/constraint-file anchoring support. This patch pins the reviewed security-sensitive application requirements without introducing a cross-platform lock over dynamic provider extras; a fully hashed gateway wheelhouse/image remains separate release work.

Wenbo11 and others added 4 commits October 10, 2026 14:07
LiteLLM 1.91.0 has two proxy bugs that hit benchflow's gateway:

- A streaming response stalls and then times out when the cached
  upstream HTTP handler that issued it is evicted and garbage collected
  mid-stream (BerriAI/litellm#24929). Fixed in 1.103.0 by
  BerriAI/litellm#34829, which keeps the handler alive while a response
  it issued is still reading.
- When a client disconnects from a stream whose request carries
  "metadata": null, the 499 cleanup raises TypeError ("'NoneType' object
  does not support item assignment") and the rest of that cleanup is
  skipped. Fixed in 1.93.0 (part of BerriAI/litellm#32258).

1.103.3 is the newest patch on the 1.103 line. It also carries the fix
for GHSA-7hp6-4w63-5g45 (1.103.0 itself is affected) and is outside the
range of the PYSEC-2026-4066 advisory that pip-audit reports for 1.91.0.

Two in-proxy patches needed changes to keep working on 1.103:

- LiteLLM now calls AnthropicConfig._is_adaptive_thinking_model with the
  provider as a second argument. The Bedrock startup patch replaced it
  with a one-argument gate, so every Claude request through the proxy
  failed with TypeError. The gate now forwards extra arguments, and the
  preflight calls the gate the way the transforms do, so this kind of
  breakage fails closed before the agent starts.
- The Gemma pass-through patch switched itself off once
  EndpointType.GEMINI existed, but LiteLLM's pass-through route still
  classifies AI Studio generateContent URLs as Vertex AI, so Gemma
  streams lost their callback (usage and trajectory) again. The patch now
  stays installed and only intercepts AI Studio paths LiteLLM labelled as
  Vertex AI.

The relock lets cryptography resolve to 50.0.2, which fixes every advisory
the pip-audit job was ignoring, so the ignores are removed.
@xdotli
xdotli temporarily deployed to pypi-internal-preview October 25, 2026 10:52 — with GitHub Actions Inactive
@xdotli
xdotli temporarily deployed to pypi-internal-preview October 25, 2026 10:55 — with GitHub Actions Inactive
@xdotli
xdotli temporarily deployed to pypi-internal-preview October 25, 2026 11:00 — with GitHub Actions Inactive
@xdotli
xdotli marked this pull request as ready for review October 25, 2026 11:06
@xdotli
xdotli temporarily deployed to pypi-internal-preview October 25, 2026 11:06 — with GitHub Actions Inactive
@bingran-you
bingran-you merged commit c8ecee8 into main Oct 29, 2026
15 of 16 checks passed
@bingran-you
bingran-you deleted the ben3-132-security-review branch October 29, 2026 01:20
xdotli added a commit that referenced this pull request Nov 6, 2026
The 0.9 line, from the accepted 0.9.0 source: the Python SDK and CLI rebuilt
after 0.7.11, with the static bfx helper for sandbox operations. 0.9.1 is 0.9.0
with ten fixes from the 0.10 line, LiteLLM 1.103.3 with patched TLS and HTTP
clients (as #1196), the two trajectory fixes of #1165, the build backend pinned
(hatchling 1.32.4), refreshed default models and a leak gate on every release
artifact. CHANGELOG.md lists the changes under [0.9.1] and [0.9.0].

This branch was previously deployed

1 inactive deployment
pypi-internal-preview — c8b7b7d0 Deployed Oct 25, 2026 by xdotli via rollout-smoke #1650
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.

3 participants