Skip to content

[Infra] Harden supply chain: remove unused scripts, add pip binary-only install - #25023

Merged
yuneng-berri merged 1 commit into
mainfrom
litellm_/fervent-noether
Apr 2, 2026
Merged

[Infra] Harden supply chain: remove unused scripts, add pip binary-only install#25023
yuneng-berri merged 1 commit into
mainfrom
litellm_/fervent-noether

Conversation

@yuneng-berri

Copy link
Copy Markdown
Contributor

Summary

Problem

Several files in the repo are supply chain attack surfaces:

  • ci_cd/publish-proxy-extras.sh — dead PyPI publish script (unreferenced by any workflow)
  • .pre-commit-config.yaml — pulls external repos from GitHub (flake8, poetry) on every git commit
  • scripts/install.sh — runs pip install without --only-binary, allowing execution of malicious setup.py in source distributions

Fix

  • Delete ci_cd/publish-proxy-extras.sh and .pre-commit-config.yaml
  • Add --only-binary :all: to scripts/install.sh to prevent source distribution execution during pip install

Testing

  • Verified ci_cd/publish-proxy-extras.sh is not referenced by any workflow or script
  • Verified .pre-commit-config.yaml is not referenced by any CI pipeline
  • scripts/install.sh change is a pip flag addition — no behavioral change for packages that publish wheels (litellm does)

Type

🚄 Infrastructure

…ly install

Remove ci_cd/publish-proxy-extras.sh (dead, unreferenced PyPI publish script)
and .pre-commit-config.yaml (pulls external repos from GitHub on git commit).
Add --only-binary :all: to scripts/install.sh to prevent execution of
malicious setup.py during pip install.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Apr 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview, Comment Apr 2, 2026 9:19pm

Request Review

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@codspeed-hq

codspeed-hq Bot commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 16 untouched benchmarks


Comparing litellm_/fervent-noether (51af6fe) with main (cae8613)

Open in CodSpeed

@greptile-apps

greptile-apps Bot commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR hardens the supply chain by deleting two files (ci_cd/publish-proxy-extras.sh, .pre-commit-config.yaml) and adding --only-binary :all: to scripts/install.sh to prevent malicious setup.py execution during pip installs.

  • ci_cd/publish-proxy-extras.sh — Clean removal of a dead, unreferenced script. No concerns.
  • .pre-commit-config.yaml — The two external-repo hooks (pycqa/flake8, python-poetry/poetry) are the actual risk (mutable tag pins on GitHub repos). However, the four local hooks (pyright, isort, black, check-files-match) use language: system and pull nothing remotely; deleting them removes useful developer quality guardrails as collateral damage.
  • scripts/install.sh — The security intent is sound, but --only-binary :all: will hard-fail on any platform where even one transitive dependency ships only a source distribution (e.g., Alpine / musl Linux, uncommon CPU architectures). More critically, the updated die() error message now tells users to retry with the same --only-binary :all: flag that just failed, leaving them with no working recovery command.

Confidence Score: 4/5

  • Safe to merge after fixing the misleading fallback error message in scripts/install.sh.
  • One P1 finding remains: the die() fallback in scripts/install.sh now suggests a command that will fail for the same reason the install just failed (missing wheel on the current platform), giving users no recovery path. Fixing it is a one-line change. The pre-commit deletion is a P2 style concern and does not block merge.
  • scripts/install.sh — the fallback error message needs the --only-binary :all: flag removed so users on wheel-less platforms have a viable recovery path.

Important Files Changed

Filename Overview
scripts/install.sh Adds --only-binary :all: to the pip install command; the security improvement is valid but can silently break installs on wheel-less platforms, and the fallback error message now suggests the same failing command.
.pre-commit-config.yaml Deleted entirely to remove external-repo supply-chain hooks; removes four local-only hooks (pyright, isort, black, check-files-match) as collateral damage.
ci_cd/publish-proxy-extras.sh Dead publish script with no references in any workflow; clean deletion with no side effects.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A([scripts/install.sh]) --> B[Detect OS & Python]
    B --> C{Python ≥ 3.9?}
    C -- No --> D([die: Python not found])
    C -- Yes --> E{pip available?}
    E -- No --> F([die: install pip])
    E -- Yes --> G["pip install --only-binary :all: --upgrade litellm[proxy]"]
    G -- Success --> H[Find litellm binary]
    G -- Failure --> I["die: Try manually with --only-binary :all: ❌\n(same flag, still fails on wheel-less platforms)"]
    H --> J{Binary found?}
    J -- No --> K([die: try --user install])
    J -- Yes --> L([Launch setup wizard])

    style G fill:#f9a,stroke:#c33
    style I fill:#fcc,stroke:#c33
    style I color:#000
Loading

Comments Outside Diff (1)

  1. .pre-commit-config.yaml

    P2 Deleting local hooks removes developer tooling unnecessarily

    The supply-chain concern is valid for the two external-repo hooks (pycqa/flake8 and python-poetry/poetry), which are pinned to mutable tags (7.0.0, 1.8.0) and could theoretically be retargeted. However, the other four hooks use language: system, meaning they run locally installed binaries and pull nothing from GitHub:

    • pyright — local system tool
    • isort — local system tool
    • black — runs via poetry run black, local
    • check-files-match — runs python3 ci_cd/check_files_match.py, local

    Removing the whole file throws away type-checking, import-sorting, formatting, and file-consistency guards that every contributor runs on git commit. A more surgical fix would remove only the two external-repo stanzas while keeping the local ones. If the intention is to drop pre-commit entirely (e.g., in favour of CI-only checks), that context would be helpful to document.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Reviews (1): Last reviewed commit: "[Infra] Harden supply chain: remove unus..." | Re-trigger Greptile

Comment thread scripts/install.sh
Comment on lines +86 to +87
"$PYTHON_BIN" -m pip install --only-binary :all: --upgrade "${LITELLM_PACKAGE}" \
|| die "pip install failed. Try manually: $PYTHON_BIN -m pip install --only-binary :all: '${LITELLM_PACKAGE}'"

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.

P1 --only-binary :all: blocks install on wheel-less platforms; fallback error points to the same failing command

--only-binary :all: tells pip to refuse to build any package from source, including transitive dependencies. While litellm itself publishes wheels, some of its heavier dependencies (e.g., cryptography, grpcio, or any native-extension package) may ship sdist-only for certain platforms — most notably musl-based Linux (Alpine / Docker slim images), unusual CPU architectures (ARM32, RISC-V, s390x), or older Python patch versions that don't yet have pre-built wheels.

When pip hits even a single sdist-only dependency it aborts the entire install with an error like:

ERROR: Could not find a version that satisfies the requirement <pkg> (from litellm)
NOTE: This error originates from a subprocess, and is likely not a problem with pip.

The more pressing problem is the updated die() message:

die "pip install failed. Try manually: $PYTHON_BIN -m pip install --only-binary :all: '${LITELLM_PACKAGE}'"

The manual command it suggests carries the same --only-binary :all: flag, so on a platform that lacks wheels it will fail again — leaving the user with no viable recovery path. The original error message (without --only-binary) would have actually worked as a fallback.

Consider either:

  1. Falling back to a non-binary install only on failure (two-step), or
  2. Keeping --only-binary :all: but fixing the error message to omit the flag so the user can self-recover:
Suggested change
"$PYTHON_BIN" -m pip install --only-binary :all: --upgrade "${LITELLM_PACKAGE}" \
|| die "pip install failed. Try manually: $PYTHON_BIN -m pip install --only-binary :all: '${LITELLM_PACKAGE}'"
"$PYTHON_BIN" -m pip install --only-binary :all: --upgrade "${LITELLM_PACKAGE}" \
|| die "pip install failed. Try manually: $PYTHON_BIN -m pip install '${LITELLM_PACKAGE}'"

@yuneng-berri
yuneng-berri merged commit 9c5fda4 into main Apr 2, 2026
100 of 109 checks passed
@yuneng-berri
yuneng-berri deleted the litellm_/fervent-noether branch April 2, 2026 21:49
fzowl pushed a commit to fzowl/litellm that referenced this pull request Jun 24, 2026
[Infra] Harden supply chain: remove unused scripts, add pip binary-only install
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