Tell HN: Litellm 1.82.7 and 1.82.8 on PyPI are compromised
TL;DR Highlight
litellm 1.82.8's .pth file stole keys and secrets whenever Python started, no import needed
Who Should Read
Backend developers who run LLM gateways or agents on litellm, directly or via DSPy or CrewAI, and pip-install the latest versions
Core Mechanics
- 1.82.8 shipped a malicious .pth file
- litellm_init.pth (34,628 bytes) was listed in the wheel's own RECORD.
- Python runs .pth files at interpreter startup, so no import litellm was needed.
- 1.82.7 is also compromised
- A commenter on the issue reported that 1.82.7 has no pth file but carries the payload in proxy/proxy_server.py.
- This came from a comment inside the issue.
- It grabbed env vars, SSH and cloud keys
- printenv captured API keys, secrets and tokens.
- Targets also included SSH keys, git credentials, AWS/GCP/Azure/Kubernetes/Docker configs, shell history and crypto wallets.
- CI/CD config files and database credential files were on the list too.
- Data was encrypted and sent out
- It made an AES-256 session key with openssl to encrypt the data, then encrypted that key with a hardcoded 4096-bit RSA public key.
- The resulting tpcp.tar.gz was POSTed with curl to https://models.litellm.cloud/.
- The exfil domain imitates the official one
- The destination is litellm.cloud while the official domain is litellm.ai.
- The payload is double base64-encoded, so a plain source grep won't show it.
- Every environment with the package is affected
- Local machines, CI/CD pipelines, Docker containers and production servers were all in scope.
- The reporter recommended rotating all credentials on any system where it was installed.
Community Reactions
- Maintainer's account of origin and scope
- The maintainer said it appears to have originated from trivy used in their CI/CD.
- They said the proxy Docker image was not affected because versions are pinned in requirements.txt.
- They said the package was quarantined on PyPI, blocking all downloads.
- Indirect dependencies widen the exposure
- A commenter noted DSPy and CrewAI also import litellm, so you may be exposed without using it as a gateway.
- Another commenter's GitHub search found 628 requirements.txt files with unpinned litellm.
- Minimum release age settings as a defense
- A commenter noted uv, npm, bun and pnpm all support a minimum release age.
- One user said they set 7 days globally, e.g. exclude-newer = "7 days" for uv.
- Sandboxing and detection tools suggested
- One commenter argued dev environments need sandboxes such as VM isolation, egress filters, seccomp and gvisor.
- Another author shared a canary tool that mounts fake secrets and alerts on access.
- The author of hexora claimed it detects close to 90% of such injections.
How to Apply
- Check installs and .pth files today
- Run pip show litellm on local, CI and container environments and check for 1.82.7 or 1.82.8.
- Search site-packages for litellm_init.pth.
- If found, rotate every env var, SSH key and cloud credential on that environment.
- Pin dependencies and use lock files
- Set exact versions for all dependencies in requirements.txt and pyproject.toml, including litellm.
- Lock projects that depend on litellm indirectly through DSPy or CrewAI.
- Add a minimum release age to your package manager
- For uv, add exclude-newer = "7 days" to ~/.config/uv/uv.toml.
- For npm, add min-release-age=7 to ~/.npmrc.
- This installs new versions only after they've been public for a while.
- Reduce and isolate secrets in CI and dev
- Keep only the env vars each CI runner and dev container really needs.
- Install new dependencies first in a sandbox or a container with restricted egress.
Try It
# Paste into a terminal (bash): check the current Python env for litellm compromise traces
pip show litellm 2>/dev/null | grep -E '^(Name|Version)'
python3 - <<'EOF'
import site, glob, os
for d in site.getsitepackages() + [site.getusersitepackages()]:
for p in glob.glob(os.path.join(d, 'litellm_init.pth')):
print('FOUND malicious file:', p)
print('scan done')
EOFTerminology
Related Papers
Frostbite: A new CPU architecture discovered, designed and verified by AI
AI agents designed a CPU from scratch, claiming 4.59x perf/W over a traditional core
Restricting AI agents in mobile operating systems platforms from capturing data
Signal now blocks OS-level AI agents from reading its screen on iOS 27 and Android
Actions Speak Louder than Words: Stateful Privacy Sniffing of LLM Agents via Behavioral Covert Channels in Web Interactions
Agents' link choices alone let attackers rebuild user queries at F1 0.89; SOR cuts it to 0.39.
Tracking and Limiting Unsupported Claim Propagation in Multi-Agent LLM Systems: A Provenance-Aware Framework
Passing claims with source, evidence and history kept equivalence at 5 agent stages at 96% versus 31%.
LLM assisted reverse engineering
Pointing an agent at binaries with skills and MD notes made years-long hacks feasible
Metrics-in-the-Loop: Complexity Feedback Reshapes Agent-Written Code
Injecting per-turn complexity reports into coding agents cut code erosion without changing correctness
Why is Gemini 4 Carbon taking so long?
Carbon took nearly an hour on bug fixes that Astra and Opus finished in minutes, mostly from extra unrequested work.
Weight-Space Programming builds neural networks like a 1990s researcher
LLM hand-wrote MNIST weights to 91.3%, using 1990s-style techniques
Related Resources
- https://github.com/BerriAI/litellm/issues/24512
- https://futuresearch.ai/blog/no-prompt-injection-required
- https://futuresearch.ai/blog/litellm-pypi-supply-chain-attack
- https://ramimac.me/trivy-teampcp/#phase-09
- https://safedep.io/malicious-litellm-1-82-8-analysis/
- https://docs.litellm.ai/blog/security-townhall-updates
- https://github.com/dweinstein/canary
- https://github.com/rushter/hexora
- https://github.com/geomys/sandboxed-step
- https://nono.sh/blog/nono-litellm
- https://www.aikido.dev/blog/telnyx-pypi-compromised-teampcp-canisterworm
- https://github.com/team-telnyx/telnyx-python/issues/235