My minute-by-minute response to the LiteLLM malware attack
TL;DR Highlight
A real-time incident response record in which an ML engineer, with the help of Claude Code, discovered and disclosed a supply chain attack hidden in litellm version 1.82.8 on PyPI within 72 minutes. It demonstrates that even non-security developers can detect and report malware using AI tools.
Who Should Read
Backend/ML engineers who use Python packages as dependencies, or developers interested in open-source supply chain security. An essential reference especially for teams using AI development tool stacks such as litellm, uvx, and Cursor.
Core Mechanics
- On March 24, 2026 at 10:52 UTC, litellm v1.82.8 was uploaded to PyPI with no corresponding GitHub tag. It appeared to be an official release but was actually a malicious package; the last legitimate version was v1.82.6.
- The attack chain was: Cursor → futuresearch-mcp-legacy (v0.6.0) → litellm (v1.82.8) → litellm_init.pth. This meant users could be infected through the dependency chain even without directly installing litellm.
- The core of the malware was the litellm_init.pth file (34KB). A .pth file is a special file that automatically executes every time Python starts, without any import statement. This file was also registered in RECORD (the official package manifest) with its sha256 hash, confirming it was included in the official wheel.
- The malware had three objectives: credential theft, lateral movement within a Kubernetes cluster, and data exfiltration. It attempted to establish persistence by creating ~/.config/sysmon/sysmon.py, but was interrupted by a forced reboot when an 11,000-process fork bomb occurred.
- The discoverer, Callum McMahon, is an ML engineer, not a security expert. Through conversations with Claude Code, he performed journalctl log analysis, confirmed the package re-download in a Docker-isolated environment, contacted the PyPI security team (security@pypi.org), and published a public blog post. Only 72 minutes elapsed from the first symptom to public disclosure.
- Claude Code took only 3 minutes to write the public blog post, create a PR, and merge it. Claude Code directly authored the disclosure post, demonstrating that AI can support not just analysis but also the communication phase.
- The malicious package was live on PyPI for approximately 46 minutes (around 10:52–12:04 before and after public disclosure). Had automated dependency updates run during that window, infection was possible — and in fact, FutureSearch's MCP server pulled that version during that period and was compromised.
Evidence
- "Discoverer Callum left a comment identifying himself as an ML engineer. He noted that 'Claude guided me step by step through contacting the PyPI security team and the time-critical sequence of actions — it was a game changer for a non-security professional.' He also asked the community whether more vulnerability reports from non-experts would be a net benefit or a burden to the security community, to which a realistic counterpoint emerged: 'The problem isn't non-expert reporting itself, but reporting in ways that make triage harder.' A highly upvoted comment highlighted the danger of .pth files: 'Most developers think pip install just puts files on disk and runs them at import time, but .pth files execute every time Python starts, with no import needed. Unlike npm's postinstall hook which runs only once, .pth files run every single time — making them far more persistent.' Concerns were also raised about Claude potentially executing malware by accident. In the transcript, the discoverer explicitly tells Claude 'please don't accidentally run this when downloading in the Docker container,' and a commenter warned: 'LLM agents have no sense of accountability — if they accidentally execute a script, it's a disaster. Sandboxing untrusted code is doable in one or two commands, but you have to be careful about delegating too much to a text prediction machine.' A '24-hour dependency update delay policy' was mentioned across multiple comments as a practical countermeasure against supply chain attacks. Commenters shared concrete experience: 'Many teams use auto-merge Dependabot PRs with no delay, which exposes them even within a 46-minute malicious package window. A simple policy of no package updates within 24 hours of release would have fully prevented this attack — uv already supports this.' There were also proposals for package registries like PyPI to provide real-time event feeds (firehoses): 'Scanners capable of instant detection already exist, but there's no channel to receive updates in real time. If GitHub, npm, and PyPI exposed real-time streams for security analysis, attacks like this could be caught much faster.' It was also noted that enterprise-scale teams need to build all packages from source or use internal mirrors, while for smaller teams, dependency pinning/locking plus a waiting period is the realistic defensive baseline."
How to Apply
- "For projects using uv, apply a 24-hour cooldown to dependency updates. This is an already-supported uv feature that prevents deployment pipelines from automatically pulling new releases immediately after publication, completely eliminating exposure windows like the 46-minute attack window in this case. If you have AI agents connected to production environments (MCP servers, Cursor plugins, etc.), audit the list of packages those agents depend on and pin their versions. Tools like uvx that dynamically pull dependencies at runtime are a particular attack surface, so consider maintaining an internal allowlist and a manual approval gate. When a system becomes unusually slow or shows a sudden spike in processes, you can use Claude Code or similar AI coding tools to jointly analyze journalctl logs, htop output, and package manifests (RECORD files). Even without security expertise, explicitly asking the AI to 'consider the possibility of malicious behavior' can accelerate early incident response significantly. Establish an isolation verification procedure for suspected malicious packages. Re-download the suspect package inside a Docker container, check the file list and whether any .pth files are present, and read the contents without executing anything. As in this case, emailing the PyPI security team (security@pypi.org) with evidence (file hashes, infection path) can result in a quarantine action."
Code Example
# How to inspect a .pth file without executing it (Docker isolated environment)
docker run --rm --network none python:3.11 bash -c "
pip install litellm==1.82.8 --dry-run 2>&1 | head -20
pip download litellm==1.82.8 -d /tmp/pkg --no-deps
cd /tmp/pkg && unzip -l litellm-*.whl | grep .pth
"
# Read the .pth file contents (without executing it)
docker run --rm --network none python:3.11 bash -c "
pip install litellm==1.82.8
cat $(python -c 'import site; print(site.getsitepackages()[0])')/litellm_init.pth
"
# Configure 24-hour dependency update delay in uv (uv.toml)
# [pip]
# upgrade-package-delay = '24h'
# List all .pth files in installed packages
python -c "
import site, os
for sp in site.getsitepackages():
for f in os.listdir(sp):
if f.endswith('.pth'):
print(os.path.join(sp, f))
"Terminology
Related Papers
Migrating a production AI agent to GPT-5.6: 2.2x faster, 27% cheaper
마케팅 웹사이트를 자동 생성하는 프로덕션 AI 에이전트를 Claude Opus 4.8에서 GPT-5.6 Sol로 전환한 실전 경험담으로, 단순 모델 교체가 아니라 eval 하네스, 툴 스키마, 캐싱, 추론 리플레이까지 손봐야 했던 과정을 구체적인 수치와 함께 정리했다.
What xAI's Grok build CLI sends to xAI: A wire-level analysis
xAI의 공식 코딩 CLI 도구 Grok Build가 사용자 동의 없이 전체 Git 저장소와 .env 시크릿 파일을 xAI 서버로 업로드한다는 사실이 네트워크 트래픽 분석으로 밝혀졌다.
Remember When It Matters: Proactive Memory Agent for Long-Horizon Agents
LLM 에이전트가 긴 작업 중 중요한 정보를 잊어버리는 문제를 별도의 메모리 에이전트가 '적절한 타이밍에' 끼어들어 해결하는 방법
WebSwarm: Recursive Multi-Agent Orchestration for Deep-and-Wide Web Search
복잡한 웹 검색을 재귀적으로 분해하고 각 노드에 적합한 검색 모드를 동적으로 할당하는 멀티에이전트 프레임워크
Show HN: Reverse-engineering web apps into agent tools
로그인된 웹 앱의 API 호출을 브라우저에서 감시해 자동으로 MCP 도구로 변환하는 에이전트를 만들었다. 소스 코드나 공식 API 문서 없이도 Jira, Spotify 같은 서비스에 AI 어시스턴트를 붙일 수 있다.
Show HN: FableCut – A browser video editor AI agents can drive (zero deps)
타임라인 전체를 JSON 파일 하나로 표현하고 MCP/REST로 AI 에이전트가 직접 편집할 수 있는 브라우저 비디오 에디터로, Claude 같은 AI가 프롬프트 하나로 영상을 자동 컷편집하고 결과를 실시간으로 UI에 반영해준다.