Skip to content

Pin litellm<=1.82.6 to avoid supply chain attack#148

Merged
Miyamura80 merged 2 commits intomainfrom
security/pin-litellm-below-vulnerable-version
Mar 24, 2026
Merged

Pin litellm<=1.82.6 to avoid supply chain attack#148
Miyamura80 merged 2 commits intomainfrom
security/pin-litellm-below-vulnerable-version

Conversation

@Miyamura80
Copy link
Owner

Summary

Test plan

  • Verify uv lock resolves successfully with the new constraint
  • Verify uv sync installs a version <=1.82.6
  • CI passes

🤖 Generated with Claude Code

Versions 1.82.7 and 1.82.8 contain a malicious payload that steals
credentials and exfiltrates them. Added upper bound pin and security
documentation in CLAUDE.md.

See: BerriAI/litellm#24512

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 24, 2026

Greptile Summary

This PR is a targeted security response that pins litellm to <=1.82.6 in pyproject.toml to block the compromised 1.82.7/1.82.8 releases, and regenerates uv.lock to reflect the new constraint.

  • pyproject.toml: litellm upper-bound added with an inline comment linking to the upstream issue — clear and intentional.
  • uv.lock: Lockfile regenerated from scratch (revision number reset to 1); the resolved litellm version should satisfy the new constraint.
  • .gitignore: Adds .vscode/ — trivial and unrelated to the security fix.
  • Missing CLAUDE.md update: The PR description explicitly lists "Adds security documentation in CLAUDE.md warning against raising the upper bound" as one of its two main changes, but CLAUDE.md is absent from the diff and currently contains no litellm security note. This is the only gap between the stated intent and the actual change.

Confidence Score: 4/5

  • Safe to merge; the core security fix is correct and complete. The only gap is the promised CLAUDE.md documentation update that was not included.
  • The pyproject.toml pin is correct and directly addresses the supply chain risk. The lockfile is consistent with the new constraint. The single remaining gap — the missing CLAUDE.md warning — is a documentation omission rather than a functional or security defect, but it was explicitly promised in the PR description and matters for preventing accidental future upgrades.
  • pyproject.toml — the CLAUDE.md security note described in the PR summary was not added.

Important Files Changed

Filename Overview
pyproject.toml Pins litellm to <=1.82.6 with an inline comment referencing the supply chain attack; the promised CLAUDE.md documentation update is missing.
uv.lock Lockfile regenerated from scratch (revision 3→1), resolving litellm to a version ≤1.82.6; other package hashes changed slightly (upload-time field removed) but versions appear stable.
.gitignore Adds .vscode/ to .gitignore; unrelated to the security fix but a safe, uncontroversial change.
Prompt To Fix All With AI
This is a comment left during a code review.
Path: pyproject.toml
Line: 20

Comment:
**CLAUDE.md security note not added**

The PR description states: *"Adds security documentation in `CLAUDE.md` warning against raising the upper bound"*, but `CLAUDE.md` is not in the diff and the file currently contains no mention of the litellm pin, the supply chain incident, or any warning against bumping `<=1.82.6`.

Without that note, a future contributor (or an AI assistant following `CLAUDE.md`) could unknowingly upgrade this constraint. The inline comment here is helpful, but the project guidance file is where reviewers and agents will look first.

How can I resolve this? If you propose a fix, please make it concise.

Reviews (2): Last reviewed commit: "⚙️ move security note from CLAUDE.md to ..." | Re-trigger Greptile

pyproject.toml Outdated
"dspy>=3.1.2",
"langfuse>=3.12.1",
"litellm>=1.59.8",
"litellm>=1.59.8,<=1.82.6",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Consider surgical exclusion instead of hard upper bound

The <=1.82.6 constraint will block all future litellm releases — including any security patches published after the compromised versions — until someone manually revises this line. An alternative is to exclude only the two known-bad versions:

litellm>=1.59.8,!=1.82.7,!=1.82.8

This lets the resolver pick up 1.82.9+ (once verified clean) without any further changes, while still protecting against the exact malicious releases.

That said, the current conservative pin is a completely valid security posture, especially while the upstream issue is still being assessed. The explicit CLAUDE.md warning makes the intent clear. This is a non-blocking suggestion.

Prompt To Fix With AI
This is a comment left during a code review.
Path: pyproject.toml
Line: 20

Comment:
**Consider surgical exclusion instead of hard upper bound**

The `<=1.82.6` constraint will block all future litellm releases — including any security patches published after the compromised versions — until someone manually revises this line. An alternative is to exclude only the two known-bad versions:

```
litellm>=1.59.8,!=1.82.7,!=1.82.8
```

This lets the resolver pick up `1.82.9+` (once verified clean) without any further changes, while still protecting against the exact malicious releases.

That said, the current conservative pin is a completely valid security posture, especially while the upstream issue is still being assessed. The explicit `CLAUDE.md` warning makes the intent clear. This is a non-blocking suggestion.

How can I resolve this? If you propose a fix, please make it concise.

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!

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valid — Good point that the hard upper bound blocks future releases including potential security patches.

Status: Not addressing (intentional) — We're deliberately using the conservative <=1.82.6 pin here. Since this was a supply chain compromise (attacker had PyPI publish access), we can't trust that subsequent versions are clean until the upstream issue is fully resolved and the publishing pipeline is verified secure. The != approach would auto-upgrade to 1.82.9+ which may or may not be safe. The CLAUDE.md note ensures someone consciously reviews before raising the bound. We'll revisit once the upstream situation stabilizes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Miyamura80 Miyamura80 merged commit f14e8e4 into main Mar 24, 2026
12 checks passed
@github-actions github-actions bot deleted the security/pin-litellm-below-vulnerable-version branch March 24, 2026 17:19
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.

1 participant