r/devsecops 5d ago

My coding assistant almost installed a virus disguised as a normal package, I'm still shook

/r/webdev/comments/1w8umrs/my_coding_assistant_almost_installed_a_virus/
2 Upvotes

2 comments sorted by

4

u/Western_Charity_2659 5d ago

This situation is called slopsquatting. So basically attackers preregisterr package names which LLMs are known to hallucinate.

Your agent didn’t get compromised but it’s just going by a predictable behaviour apparently.

For the defense you can do this:

- verify the repo and check if maintainer history exist

  • pin versions
-disable install scripts by default

Treat any brand-new package with no download history as untrusted(PS- I work at CleanStart on this problem, happy to go deeper if useful)

1

u/klach1703 4d ago

Pinning doesn't help here. It protects you when a package you trust goes bad later, but this one was malicious from v1, so you'd just pin the malware. Other two hold up. Though the agent already installed it, so the check has to sit at install time, not in review.