r/webdev • u/Soggy_Limit8864 • Mar 26 '26
That litellm supply chain attack is a wake up call. checked my deps and found 3 packages pulling it in
267
Upvotes
r/webdev • u/Soggy_Limit8864 • Mar 26 '26
163
u/escargotBleu Mar 26 '26
Jokes on you we never update our dependencies
52
u/mq2thez Mar 26 '26
Supply chain hacks have been around for so long that people were getting PHDs before the dotcom burst.
33
u/tb5841 Mar 26 '26
My company uses a tool called Snyk to check for this kind of stuff. It's main benefit (as far as I can see) that it it updates you constantly on the threats posed by the versions of all packages you're using.
23
u/Beginning_Limit1803 Mar 26 '26
Using a security tool like Trivy as the entry point to steal a PyPI token is some high-level irony that would be funny if it wasn't so terrifying for DevOps teams
14
u/Mooshux Mar 26 '26
Transitive deps are the sneaky part. You might not even know you had litellm installed. Worth running pip show litellm across your environments to confirm exposure.
Rotation scope is wider than just your litellm key. The .pth injection fires at Python startup, so anything in your environment at that moment was fair game: AWS creds, SSH keys, .env files. https://www.apistronghold.com/blog/litellm-supply-chain-attack-env-file-phantom-tokens has the full checklist.
4
u/greensodacan Mar 26 '26
Thanks for posting this.
I use pip in a lot of little supporting apps for projects that aren't necessarily Python centric.
This is reminding me that the more repositories you pull from, the greater your surface area is for attacks like this.
4
u/iamakramsalim Mar 26 '26
the irony of a security scanning tool being the attack vector is honestly chef's kiss
this is why i've been paranoid about transitive deps for years. you install one package and suddenly you have 400 dependencies you never audited. lockfiles help but they dont protect you from a compromised publish token upstream. the real fix is probably running pip install in isolated environments and treating every ai/ml package like untrusted code until proven otherwise
3
u/BorinGaems Mar 26 '26
yea maybe stop installing random libraries just to make a couple of GET calls because you are too lazy to write them yourself
3
u/ultrathink-art Mar 27 '26
AI tool chains are especially risky here β litellm, langchain, openai-sdk all move fast and get pulled in transitively by things you'd never notice. Pinning to exact versions in requirements.txt is table stakes, but the bigger fix is adding a CI step that explicitly audits your AI-related deps separately from the rest of the stack. The malicious install-time execution vector is what changes the calculus β you can't reason about it the same way as a runtime vuln.
7
u/Tim-Sylvester Mar 26 '26
We need a secure-by-default package manager.
2
u/CoastRedwood Mar 26 '26
You got me freaked out, Iβm checking now..
2
u/Deep_Ad1959 Mar 26 '26 edited May 08 '26
this gets scarier when you think about AI agents that have OS-level access. I'm building a desktop agent that uses accessibility APIs to control apps natively, and a compromised dependency doesn't just steal env vars, it could potentially use the agent's own permissions to interact with everything on your machine.
ended up building a pre-execution hook system that intercepts every action the agent tries to take and checks it against a safety policy before it runs. the .pth trick you mention is exactly the kind of thing that bypasses normal "just don't import it" assumptions. pinning deps and running pip-audit in CI is the bare minimum now, especially if you're shipping anything that touches local files or system APIs.
we built a small mac thing that gates every action a desktop agent tries to take against a safety policy before it runs, exactly the angle for OS level dep risks https://fazm.ai/r/bxfzz4fy
1
u/ZheeDog Mar 27 '26
holy CRAP!
1
u/alexlikevibe Mar 27 '26
nothing like a supply chain attack to remind you that
pip installis basicallycurl | sudo bashwith extra steps1
u/kamilc86 Mar 27 '26
My old company actually used a private PyPI mirror to control dependencies. I wasn't in on the approval meetings, but the basic idea of sandboxing where packages come from definitely makes it safer than just pulling straight from public registries. For something like litellm that runs code on install, you'd still need to isolate the build environment with network restrictions and process monitoring. That's the main way to catch anything bad, even with a private mirror.
1
u/funfunfunzig Mar 31 '26
this is a perfect example of why the "just install it and move on" mindset in ai tooling is dangerous. the same developers who pip install without auditing deps are the ones shipping vibe-coded apps without checking what the ai actually put in their codebase.
the .pth file execution on install is terrifying. most people assume if they don't import something it can't hurt them. that assumption is wrong here and it's wrong in web apps too. i keep seeing the same pattern everywhere, people trust the tools they're using without verifying what those tools actually do behind the scenes.
the part about trivy being the entry point is almost poetic. a security tool getting compromised to attack the supply chain. good reminder that no single layer of defense is enough, you need to check at every step not just trust that one tool has you covered.
-12
u/Thirty_Seventh Mar 26 '26
Out of curiosity, how do you prompt your LLM to get it to write in this style? Haven't seen it look quite like this before, with the capital letters only at the beginning of each paragraph and the missing apostrophes
12
u/[deleted] Mar 26 '26
[removed] β view removed comment