Three files, and Python does the rest
According to Microsoft, the wheel packed cook.pth, cook.py and sitecustomize.py under litellm-1.107.0.data/purelib/. On install they land in the environment's library directory, outside the litellm folder. Python's normal site initialisation processes executable lines in .pth files and later imports sitecustomize. So the single line import cook in the .pth file was enough to start things.
The decoded program calls itself PRIVCOLLECT and collects in a daemon thread. Microsoft saw it fire on Windows and macOS endpoints. In one Windows case, a routine Python call to install an unrelated dependency triggered it. A separate module tried to read credential and model-configuration records from the LiteLLM proxy database.
Microsoft also describes a Unix loader that can fetch and run more Python code. It says that activity was not confirmed. Keep that sentence in mind for the hype section.
The root cause story has already been rewritten once
Microsoft says LiteLLM's maintainers reported that stolen developer GitHub credentials were used to redirect the release workflow to a lookalike repository, Berri-AI/litellm, and that another developer's credential satisfied the production approval. Microsoft has not independently determined how the attacker first got in.
The first explanation was different. MadRobot's report relayed BerriAI's claim that GitHub tokens leaked from its own gateway's logs, and blamed Claude Code embedding tokens in response bodies. It noted Anthropic hadn't commented. MaruOps now says the official October 23 report corrects earlier assumptions: a platform master key exposed in a public repository in May was never revoked, and the attacker used it to reach an organisation owner's token. That's LiteLLM's account, not something we've seen independently verified. Treat the log theory as superseded.
What's real, what's noise
Real: the exposure window was short but the target was well chosen. MadRobot reports PyPI removed the release by 13:23 UTC, while tainted Docker tags stayed up until 14:20. It also cites Socket's figure of about 23 million weekly downloads. A gateway sits on provider keys, database strings and cloud identities, so one install can hand over many things at once. It was also the second hijack this year, per Fuller-Smith, after a March incident involving 1.82.7 and 1.82.8.
Noise: this isn't an AI attack. It's a package hijack with a payload aimed at where AI teams keep their secrets. The "hourly loader" sounds scary, but The Stack says the GitHub repo it polled went offline about two hours after release. Second-stage code delivered earlier may still have run. Nobody has shown whether it did, and Microsoft calls it unconfirmed.
The unglamorous lesson: an unrevoked key and relaxed release approvals did more damage than any clever technique.
What to do this week
Start with an inventory, not a fix. Microsoft is explicit that you shouldn't start Python or pip inside a suspect environment, because that can trigger the payload again. Inspect the filesystem and image metadata from outside.
- Find every place 1.107.0 could have been installed: laptops, CI agents, test boxes, containers. Look for
cook.pth,cook.pyandsitecustomize.pyin site-packages. - Check the image digests that actually ran, not what a tag points to today. A clean
latestnow says nothing about a container started on October 21. - If it was there, treat the host as compromised, rebuild it, and rotate everything it could reach: cloud roles, every provider key in the proxy database, master and virtual keys, the database password.
- Revoke, don't just delete. Microsoft says removing the package or a release tag is not recovery.
- Pin to a known clean version. The Stack lists 1.106.2, 1.107.0rc1 and 1.107.0rc2 as clean.
Where this leaves gateway design
If we were putting a gateway in front of models this quarter, we'd assume the package will be compromised someday and limit the damage. Scope provider keys per environment, set spend caps at the provider, and keep the gateway off machines that hold cloud admin credentials. That's the same thinking we apply in our AI workflow automation work: the integration layer is a privileged service, so it gets a privileged service's hygiene.
Sources
- Inside the LiteLLM 1.107.0 supply chain compromise: Credential theft through Python startup hooks · Microsoft Security Blog
- LiteLLM 1.107.0 hacked: PyPI release stole AI and cloud keys · MadRobot
- IT briefing, October 25, 2026: seven stories on security, AI and Windows · MaruOps
- LiteLLM 1.107.0 on PyPI was malicious · The Stack
- LiteLLM Was Compromised on Wednesday. My Container Was Three Weeks Old, and I Still Checked · Fuller-Smith Build Log
Want this working in your stack, not just in a demo?
We are two senior engineers who build ai workflow automation with a fixed price per written scope.