Slopsquatting
A software supply chain attack in which attackers register, ahead of time, nonexistent package names that an AI invented while generating code, so that people end up installing malicious code.
What does Slopsquatting mean in simple terms?
When you ask AI for code, it often tells you which libraries to install as well. Sometimes, though, the AI makes up a plausible package name that does not exist. If an attacker finds these fake names first and registers them as malicious packages on a public registry, anyone who installs what the AI suggested gets malicious code on their computer. Slopsquatting combines slop, meaning sloppy AI output, with squatting, meaning grabbing someone else's name. It is a risk worth knowing as more people take and run code through vibe coding.
How can Slopsquatting be explained with an analogy?
It is like a guide who, asked for directions, makes up the name of a shop that does not exist, and a con artist then opens a shop under that name and waits.
Where is Slopsquatting used?
University of Texas at San Antonio and other researchers — Large-scale analysis of package hallucinations
A paper presented at USENIX Security 2025 analyzed 576,000 code samples produced with 16 code-generating models.[1] The average share of hallucinated packages was at least 5.2% for commercial models and 21.7% for open-source models, and 205,474 unique fake package names appeared.[1]
Result: Confirmed that package hallucination is not a fluke of a few models but large enough to be a supply chain threat (per the paper).[1]
Socket — Spreading the term and explaining the risk
In an April 2025 post, security company Socket described slopsquatting as registering nonexistent package names that LLMs make up.[2] It said the term was coined by Seth Larson of the Python Software Foundation.[2]
Result: The warning to check dependencies suggested by coding agents before installing them spread through the developer community (per the blog post).[2]
Learning steps, limitations and developments
- Before running an install command the AI gave you, search for the package name on the official registry (PyPI or npm).
- Hold off on installing packages with almost no downloads or that were registered only recently.
- Set coding agents not to install dependencies automatically, and have a person check the list of added packages.
- For team projects, maintain a list of the packages you use and review any new package before adding it.
Not every fake name leads to a real attack. But when the same fake name comes up again and again for the same question, it becomes an easy target for attackers to register in advance. Because hallucinations do not disappear completely even as models improve, making a habit of verifying packages before installation is the surest defense.
How has Slopsquatting evolved?
Which concepts are related to Slopsquatting?
- Underlying phenomenonHallucinationWhy AI makes up package names that do not exist
- Related contextVibe CodingThe risk grows when generated code runs without review
- CountermeasureSBOMA way to manage the list of packages in use
- Similar conceptAI SlopLow-quality AI output produced in bulk without checks
Typosquatting vs Slopsquatting
Which sources explain Slopsquatting?
- Spracklen et al. (USENIX Security Symposium) — We Have a Package for You! A Comprehensive Analysis of Package Hallucinations by Code Generating LLMs (2025) — https://www.usenix.org/conference/usenixsecurity25/presentation/spracklen
- Socket — The Rise of Slopsquatting: How AI Hallucinations Are Fueling a New Class of Supply Chain Attacks (2025-04-08) — https://socket.dev/blog/slopsquatting-how-ai-hallucinations-are-fueling-a-new-class-of-supply-chain-attacks
Tell us what you think
Your feedback helps us improve the content.