Safety & security

Slopsquatting

AI-assisted editorial review:

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?

Case 1

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]

Case 2

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

  1. Before running an install command the AI gave you, search for the package name on the official registry (PyPI or npm).
  2. Hold off on installing packages with almost no downloads or that were registered only recently.
  3. Set coding agents not to install dependencies automatically, and have a person check the list of added packages.
  4. 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?

2024.06
Package hallucination research released
Code-generating models inventing nonexistent packages is analyzed with numbers.
2025.04
Slopsquatting
The attack of grabbing fake package names gets a name and becomes widely known.
2025.08
Presented at USENIX Security
The package hallucination paper is formally presented at a security conference.

Which concepts are related to Slopsquatting?

  • Underlying phenomenon
    HallucinationWhy AI makes up package names that do not exist
  • Related context
    Vibe CodingThe risk grows when generated code runs without review
  • Countermeasure
    SBOMA way to manage the list of packages in use
  • Similar concept
    AI SlopLow-quality AI output produced in bulk without checks

Typosquatting vs Slopsquatting

ComparisonTyposquattingSlopsquatting
Mistake exploitedA human typoA name the AI made up
Fake nameSpelled like a real packagePlausible but never existed
Path to harmA person types it wrongRunning the AI's suggested install command as is
PreventionCheck spelling and use autocompleteCheck existence and history on the official registry before installing

Which sources explain Slopsquatting?

  1. 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
  2. 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